Description
PyGMT now supports the newer Frame/Axis syntax for frame settings (#4406), although it is still not feature-complete. However, many examples and documentation pages continue to use the legacy string- or list-based frame arguments. It would be beneficial to migrate these usages so that the codebase consistently demonstrates and promotes the newer syntax.
I'm still debating whether to continue supporting string-style frame settings (e.g., frame="WSen", frame="afg"), considering that they're simple and widely used. However, at a minimum, list-style frame settings should be migrated to the Frame/Axis classes.
For example:
frame=["xa10", "ya5", "+tTitle"]=>frame=Frame(xaxis=Axis(annot=10), yaxis=Axis(annot=5), title="Title")
To locate remaining usages of string- or list-based frame settings, you can use:
grep -R 'frame="' **/*.pygrep -R 'frame=\[' **/*.py
Contributions are welcome! A good way to help would be to:
- Identify files or cases that still use string or list-based frame arguments
- Update them to use Frame/Axis where appropriate
- Verify that the updated examples render correctly
- Submit small, focused PRs
Below is a list of files that still use the list-based frame settings:
- examples/gallery/3d_plots/3d_bar.py
DOC/Gallery example "3-D bar plot": Migrate frame settings to the new Frame/Axis syntax #4496 - examples/gallery/3d_plots/grdview_surface.py
DOC/Gallery example "Plotting a surface": Migrate frame settings to the new Frame/Axis syntax #4497
DOC/Gallery example "Plotting a surface": Migrate frame settings to the new Frame/Axis syntax; part 2 #4504
params.Frame: Allow setting 'axis' and 'zaxis' simultaneously #4498 - examples/gallery/3d_plots/scatter3d.py
DOC/Gallery example "3-D scatter plots": Migrate frame settings to the new Frame/Axis syntax #4502 - examples/gallery/basemaps/double_y_axes.py
DOC/Gallery example "Double Y-axes graph": Migrate frame settings to the new Frame/Axis syntax #4503 - examples/gallery/basemaps/ternary.py
DOC/Gallery example "Ternary diagram": Migrate frame settings to the new Frame/Axis syntax #4505 - examples/gallery/embellishments/colorbar.py
DOC/Gallery example "Colorbars": Migrate frame settings to the new Frame/Axis syntax #4506 - examples/gallery/embellishments/colorbars_multiple.py
DOC/Gallery example "Multiple colormaps": Migrate frame settings to the new Frame/Axis syntax #4507 - examples/gallery/embellishments/inset.py
DOC/Gallery example "Inset": Migrate frame settings to the new Frame/Axis syntax #4508 - examples/gallery/embellishments/inset_rectangle_region.py
DOC/Gallery example "Inset map showing a rectangular region": Migrate frame settings to the new Frame/Axis syntax #4511 - examples/gallery/embellishments/legend.py
DOC/Gallery example "Legend": Migrate frame settings to the new Frame/Axis syntax #4512 - examples/gallery/embellishments/scalebar.py
DOC/Gallery example "Scale bar": Migrate frame settings to the new Frame/Axis syntax #4513 - examples/gallery/histograms/blockm.py
DOC/Gallery example "Blockmean": Migrate frame settings to the new Frame/Axis syntax #4514 - examples/gallery/histograms/histogram.py
DOC/Gallery example "Histogram": Migrate frame settings to the new Frame/Axis syntax #4521
params.Frame: Add parameters 'fill' for filling the base map #4520 - examples/gallery/histograms/rose.py
DOC/Gallery example "Rose diagram": Migrate frame settings to the new Frame/Axis syntax #4522 - examples/gallery/histograms/scatter_and_histograms.py
DOC/Gallery example "Scatter plot with histograms": Migrate frame settings to the new Frame/Axis syntax #4523 - examples/gallery/images/cross_section.py
- examples/gallery/images/grdclip.py
- examples/gallery/images/grdgradient_shading.py
- examples/gallery/images/grdgradient.py
- examples/gallery/images/rgb_image.py
- examples/gallery/lines/connection_lines.py
- examples/gallery/lines/envelope.py
- examples/gallery/lines/hlines_vlines.py
- examples/gallery/lines/line_custom_cpt.py
- examples/gallery/lines/wiggle.py
- examples/gallery/seismology/velo_arrow_ellipse.py
- examples/gallery/symbols/datetime_inputs.py
- examples/gallery/symbols/multi_parameter_symbols.py
- examples/gallery/symbols/points_categorical.py
- examples/gallery/symbols/points_transparency.py
- examples/gallery/symbols/scatter.py
- examples/intro/01_first_figure.py
- examples/intro/03_figure_element.py
- examples/projections/nongeo/cartesian_linear.py
- examples/projections/nongeo/cartesian_logarithmic.py
- examples/projections/nongeo/cartesian_power.py
- examples/projections/nongeo/polar.py
- examples/tutorials/advanced/3d_perspective_image.py
- examples/tutorials/advanced/cartesian_histograms.py
- examples/tutorials/advanced/date_time_charts.py
- examples/tutorials/advanced/grid_equalization.py
- examples/tutorials/advanced/non_ascii_text.py
- examples/tutorials/advanced/subplots.py
- examples/tutorials/basics/frames.py
- examples/tutorials/basics/text.py
- pygmt/helpers/testing.py
- pygmt/src/colorbar.py
- pygmt/src/grdview.py
- pygmt/tests/test_alias_system.py
- pygmt/tests/test_basemap.py
- pygmt/tests/test_config.py
- pygmt/tests/test_geopandas.py
- pygmt/tests/test_grdview.py DOC/Test "test_grdview": Migrate frame settings to the new Frame/Axis syntax #4532
- pygmt/tests/test_helpers.py DOC/Test "test_helper": Migrate frame settings to the new Frame/Axis syntax #4530
- pygmt/tests/test_plot.py DOC/Test "test_plot": Migrate frame settings to the new Frame/Axis syntax #4526
- pygmt/tests/test_plot3d.py DOC/Test "test_plot3d": Migrate frame settings to the new Frame/Axis syntax #4519
- pygmt/tests/test_rose.py DOC/Test "test_rose": Migrate frame settings to the new Frame/Axis syntax #4518
- pygmt/tests/test_ternary.py
- pygmt/tests/test_text.py DOC/Test "test_text": Migrate frame settings to the new Frame/Axis syntax #4516
- pygmt/tests/test_velo.py DOC/Test "test_velo": Migrate frame settings to the new Frame/Axis syntax #4515
Activity
seisman commentedon Apr 11, 2026
@Chuan1937 @yvonnefroehlich I've asked
@copilotto work on the issue, then we can focus on reviewing.seisman commentedon Apr 13, 2026
I think we have already finished the migration in most files. Here are a few remaining files:
seisman commentedon Apr 14, 2026
I was working on
examples/intro/03_figure_element.pyin PR #4584, but the result does not look ideal. I think this tutorial needs a new design.yvonnefroehlich commentedon Apr 14, 2026
Jupp, also found yesterday night that updating this intro will be not straight forward.
seisman commentedon Apr 29, 2026
I think we're done with the migration. The only one left is the Intro Tutorial for figure elements, which will be addressed in #4610.
Closing.