You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Higher-level plotting methods for scale bar, map direction rose and magnetic rose? #2831
The basemap and coast modules provide the exactly same options for adding scale bars (-L), direction rose (-Td) and magnetic rose (-Tm) to maps.
I think it's more intuitive if we can provide three different higher-level plotting methods, e.g., Figure.scale_bar, Figure.direction_rose, Figure.magnatic_rose?
I'll take the Figure.scale_bar as an example. The -L full syntax is:
The basemap and coast modules provide the exactly same options for adding scale bars (-L), direction rose (-Td) and magnetic rose (-Tm) to maps.
I think it's more intuitive if we can provide three different higher-level plotting methods, e.g., Figure.scale_bar, Figure.direction_rose, Figure.magnatic_rose?
I agree that separate methods for scale bar, direction rose, and magnetic rose are more user-friendly. Especially they are easier to find for new users. I remember myself searching for a separate GMT module to add a scale bar (similar to adding a colorbar) until I figured out that this is included in the basemap module 😅.
Of course, we also need to decide what to do with the box parameter.
Hm. Is it possible to include box as a parameter within the new high-level method Figure.scale_bar (similar to Figure.legend or Figure.colorbar) even both box (-F) and scale_bar (-L) are currently parameters of Figure.basemap or Figure.coast?
Of course, we also need to decide what to do with the box parameter.
Hm. Is it possible to include box as a parameter within the new high-level method Figure.scale_bar (similar to Figure.legend or Figure.colorbar) even both box (-F) and scale_bar (-L) are currently parameters of Figure.basemap or Figure.coast?
Yes, but the box parameter's syntax (-F[d|l|t][+cclearances][+gfill][+i[[gap/]pen]][+p[pen]][+r[radius]][+s[[dx/dy/][shade]]]) is very non-Pythonic. Since it's a "common" option used in several modules, I feel it's reasonable to define a Box class.
Activity
yvonnefroehlich commentedon Nov 26, 2023
I agree that separate methods for scale bar, direction rose, and magnetic rose are more user-friendly. Especially they are easier to find for new users. I remember myself searching for a separate GMT module to add a scale bar (similar to adding a colorbar) until I figured out that this is included in the
basemapmodule 😅.Hm. Is it possible to include
boxas a parameter within the new high-level methodFigure.scale_bar(similar toFigure.legendorFigure.colorbar) even bothbox(-F) andscale_bar(-L) are currently parameters ofFigure.basemaporFigure.coast?seisman commentedon Nov 27, 2023
Yes, but the
boxparameter's syntax (-F[d|l|t][+cclearances][+gfill][+i[[gap/]pen]][+p[pen]][+r[radius]][+s[[dx/dy/][shade]]]) is very non-Pythonic. Since it's a "common" option used in several modules, I feel it's reasonable to define aBoxclass.seisman commentedon Dec 18, 2025
We have decided to implement the three methods separately. The progress will be tracked in #4303, #4302, #4268.