Skip to content
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

Improved plotting #209

Merged
merged 27 commits into from
Jan 17, 2020
Merged

Improved plotting #209

merged 27 commits into from
Jan 17, 2020

Conversation

MarkWieczorek
Copy link
Member

@MarkWieczorek MarkWieczorek commented Jan 14, 2020

This pull request refactors the SHGrid.plot() routine by adding a number of optional arguments along with support for projections using Cartopy and pygmt.

  • An incorrect 0.5 pixel offset was fixed when plotting grids via matplotlib.
  • Grids correctly plot both 0 and 360 degrees using the new "extended" grids of SHGrid.
  • Improved handling of xarrays and netcdf I/O.
  • Support for Cartopy projections, by specifying: SHGrid.plot(projection=ccrs.ProjectionName()).
  • Improved plotting and placement of colorbars. New optional arguments include cb_label for labels, cb_ylabel for a label on the y axis of the colorbar, cb_tick_interval for specifying the major tick interval, cb_minor_tick_interval for specifying minor tick intervals, cb_triangles for plotting upper/lower limit triangles at the ends of the colorbar, and cb_offset to override the default spacing between the map and colorbar.
  • Improved colormap handling: New optional arguments include cmap_limits to specify the lower and upper bounds of the data, as well as an interval for constant color intervals, and cmap_reverse to reverse the colormap.
  • Improved handling of ticks and annotations: The optional argument ticks specifies which ticks and annotations to show, using a syntax from gmt (i.e., 'WSen').
  • Experimental support for pygmt using the routine plotgmt. This function takes nearly the same arguments as plot(). As soon as pygmt implements projection classes (Implement Projection classes to encapsulate arguments GenericMappingTools/pygmt#379), this will be incorporated into the plot function in the same manner as cartopy was.
  • All gravity, magnetics, tensor, localization windows and slepian function plotting routines incorporate these changes.
  • Added a new introductory notebook that shows how to use all features of the plot() function.

Other changes:

  • New methods SHGrid.to_real() and SHGrid.to_imag() return the real and imaginary components of a complex SHGrid instance.
  • Added an optional argument copy to SHCoeffs.pad().

@MarkWieczorek MarkWieczorek added this to the GMT milestone Jan 14, 2020
This was referenced Jan 14, 2020
@MarkWieczorek MarkWieczorek merged commit c04b9bf into SHTOOLS:develop Jan 17, 2020
@MarkWieczorek MarkWieczorek deleted the cartopy branch July 23, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant