BoldingBruggeman / pyncview

PyNcView is a cross-platform NetCDF viewer written in Python. It provides an easy-to-use graphical user interface to the creation of animations and publication-quality figures.
GNU General Public License v2.0
18 stars 1 forks source link

Add two buttons for easier colorbar handling #5

Open markusReinert opened 3 years ago

markusReinert commented 3 years ago

This commit adds two buttons to the slicing tab if the current figure has a colorbar. A click on the first button makes the colorbar symmetric about zero, the second button allows to quickly switch between recently used colormaps.

It is often useful to show positive and negative values in a colorplot with two different colors, for example when we look at velocity. To do this, it has so far been necessary to click "Properties", set the minimum and maximum value of the colorbar to be symmetric about zero and to choose a diverging colormap. This commit simplifies this workflow by putting all these actions in a single button.

Since this new button changes the colormap, we might want to switch back to the previously used colormap when we look at a different quantity that is not symmetric about zero. For this purpose, a menu button is added as well, which allows to switch from the current colormap back to a recently used colormap. This menu also suggests some commonly used colormaps, and is a lot faster to use than the complete colormap-menu in the "Properties" dialog.

markusReinert commented 3 years ago

@jornbr Hi Jorn, did you already have time to look at my proposed modifications? Cheers, Markus

jornbr commented 3 years ago

Hi Markus,

Thanks for the reminder, I'll take a look this week. Great that you've worked on extending PyNcView!

Cheers,

Jorn

markusReinert commented 2 years ago

Hi Jorn,

I made my pull request up-to-date with the current version of pyncview. Also, I added a commit to my pull request that increases the pyncview version number. This seems to be a logical step for when my pull request is accepted. What do you think about my suggested feature @jornbr?

Best regards, Markus

markusReinert commented 1 year ago

Ready to merge, @jornbr .