GenericMappingTools / pygmt

A Python interface for the Generic Mapping Tools.
https://www.pygmt.org
BSD 3-Clause "New" or "Revised" License
747 stars 216 forks source link

The gallery thumbnails are too small #1038

Closed seisman closed 3 years ago

seisman commented 3 years ago

Description of the problem

Here is a comparison between the PyGMT gallery and the matplotlib gallery

PyGMT Matplotlib
image image

You may notice that the PyGMT gallery thumbnails are always smaller than the ones in matplotlib and sphinx-gallery. The reason is that we limit the max width of images to 80% in the CSS:

https://github.com/GenericMappingTools/pygmt/blob/aff5db7f0f3d13e75313648528a50edcd2500b80/doc/_static/style.css#L41-L43

We made the change in #420 to avoid too large badges in the changelog file (https://github.com/GenericMappingTools/pygmt/pull/420#issuecomment-622162738). Apparently, the 80% CSS style is not ideal, and it affects all images.

The simplest solution is changing max-width to 100%. Here is a comparison if we change the max-width to 100%. The gallery thumbnails look larger and better.

max-width=80% max-width=100%
image image

However, it also increases the size of other images to 100%. For example,

max-width=80% max-width=100%
image image
image image

To me, 80% max-width looks better for these individual large images, but 100% max-width looks better for gallery thumbnails.

We should find a way to control the different settings of the two groups of images.

BTW, looking at the matplotlib gallery, I think we can also:

maxrjones commented 3 years ago

I agree that 100% max-width looks better for the thumbnails. For the ROSES tutorial (and generally files in the .rst files), we can just set the width to 80% in the figure directive rather than relying on max-width. For any fig.show() output, I think it could be better to not scale the images at all given that it obscures the purpose of the width or height in -J.

willschlitzer commented 3 years ago

I agree that bigger thumbnails look better.