Skip to content

Refactor rc_configurator and geoaxes, add new gridline features #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 102 commits into from
May 19, 2020

Conversation

lukelbd
Copy link
Collaborator

@lukelbd lukelbd commented May 14, 2020

Resolves #61, resolves #165, and resolves #27. This PR makes several improvements to rc_configurator and cleans up the settings as follows:

  • There is no longer a distinction in the documentation between "quick settings" and settings "added by proplot". The only real difference was that "quick" settings had no dots, but the more meaningful differences have disappeared over time -- some quick settings and "added" settings both had children (e.g. tick.color changes both xtick.color and ytick.color) while other quick settings and "added" settings had no children (e.g. inlinefmt).
  • There is a new cartopy.global rc setting that determines whether the extent of projections is global or is determined by content plotted in the axes like in cartesian axes. The default is True. May add other cartopy rc settings in the future.
  • The default values for the font size settings small and large are now the relative sizes 'medium' and 'med-large' (proplot adds 'med-small' and 'med-large' to font_scalings). Relative font sizes are a builtin matplotlib feature that I was not aware of when I implemented these settings.
  • I have renamed small and large to font.labelsize and font.titlesize to reflect the fact that their usage should be discouraged in favor of modifying the font.size point size, and letting the relative sizes rc['font.labelsize'] = 'medium' and rc['font.titlesize'] = 'med-large' scale everything up automatically.
  • I have decided to remove the separate grid and geogrid settings, because this was confusing for many users (e.g. Why doesn't "x" work with cartopy/basemap plots? #131) and there was not much justification for this extra complication -- and if we have geogrid settings, why not also have polargrid? I have also removed the related geoaxes settings.
  • I added new cartography-specific settings under grid and gridminor -- namely grid.loninline, grid.latinline, grid.lonstep, grid.latstep, grid.latmax, grid.labels, grid.labelpad, grid.labelsize, grid.labelrotate, gridminor.latstep, and gridminor.lonstep. These are simply ignored by cartesian and polar axes.
  • GeoAxes.format() now has dms, loninline, latinline, and rotatelabels keyword args for controlling cartopy gridline behavior.
  • I added the grid.below setting as a more obvious alias for axes.axisbelow that addresses Map projection gridlines are layered much too high #61. The default is the same as matplotlib's default, i.e. rc['grid.below'] = 'line'. This puts gridlines below lines but above patches like filled contours.
  • I added new zorder options to all the cartographic feature settings, i.e. land.zorder, coast.zorder, etc. The default value for all is 0.75 so that they appear below all plotted content, but they will appear above gridlines if grid.below is set to True (which corresponds to zorder=0.5). This way you can also create land and ocean masks on top of plotted content with e.g. plot.rc['land.zorder'] = 3 or plot.rc['ocean.zorder'] = 3.
  • I added 'x-hi' and 'xx-hi' as options for the rc.reso setting. The basemap resolution mapping is 'lo' --> 'c' (crude), 'med' --> 'l' (low), 'hi' --> 'i' (intermediate), 'x-hi' --> 'h' (high), and 'xx-hi' --> 'f' (fine). This is so they roughly correspond to the available cartopy resolutions 'lo' --> '110m', 'med' --> '50m', and 'hi' --> '10m'. Basemap resolutions can get way higher than cartopy. Also before there was a bug where the proplot ignored rc.reso when making Basemap instances -- this is now fixed.

Note that none of these removals will cause anyone's old code to error. ProPlot now uses a simple deprecation system (see internals/warnings.py) that emits warnings and translates old names to new names where possible.

@lukelbd lukelbd force-pushed the geogrid-features branch from fd9a374 to fbf7fd1 Compare May 14, 2020 07:27
@lukelbd lukelbd changed the title Add geogrid settings Update rc configurator, deprecate some settings, and add "minor geogrid" settings May 17, 2020
@lukelbd lukelbd changed the title Update rc configurator, deprecate some settings, and add "minor geogrid" settings Update rc configurator, support minor geographic gridlines, and refactor geoaxes May 19, 2020
@lukelbd lukelbd changed the title Update rc configurator, support minor geographic gridlines, and refactor geoaxes Refactor rc_configurator and geoaxes, add new gridline features May 19, 2020
@lukelbd lukelbd merged commit dc76d19 into master May 19, 2020
@lukelbd lukelbd deleted the geogrid-features branch May 19, 2020 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong grid line labels with Lambert projection Map projection gridlines are layered much too high "Minor" longitude and latitude gridlines
1 participant