GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Left-aligned annotations for the right-side Y axes and colorbars? · Issue #8956 · GenericMappingTools/gmt

Left-aligned annotations for the right-side Y axes and colorbars? #8956

New issue
Copy link
New issue
Copy link
Open
Open
Left-aligned annotations for the right-side Y axes and colorbars?#8956
Copy link
Labels
feature requestRequest a new feature

Description

@mkononets
mkononets
opened on Mar 28, 2026
Issue body actions

Left-aligned annotations for the right Y axis have been a de facto standard, see gnuplot, matplotlib, etc
see e.g. https://gnuplot.sourceforge.net/demo_6.0/multiaxis.html for gnuplot
https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html for matplotlib, specifically https://matplotlib.org/stable/_images/sphx_glr_secondary_axis_005.png further down

The same request applies for colorbar annotations. See examples here https://gnuplot.sourceforge.net/demo_6.0/pm3d.html. gnuplot apparently does special treatment for the negative tick annotations, excluding the minus sign from the alignment and adding an extra minus-length-sized offset. matplotlib does not seem to do that.

It appeared to be relatively easy to create a workaround for the 2d plotting, right Y axis annotations, positive values (w/o the minus sign). Not clear at all how to do this for the colorbar annotations unfortunately.

GMT by default provides the right Y axis annotations aligned to the right, same for gmt colorbar (gmt colorbar not shown). Further down is the desired result (positive values only). In case negative values present, there should be an extra offset from the axis equal to the length of that long minus sign character plus some extra (the distance between that minus and the following digit). Not sure how to include this into the workaround, suggestions are very welcome:

gmt basemap -R-500/500/-500/500 -JX5c -BWSNE -Bpy500f -Bpx500f -png right-annots
Image

See below the desired result. In case negative values present, there should be an extra offset from the axis equal to the length of that long minus sign character plus some extra (the distance between that minus and the following digit). Not sure how to include this into the workaround, suggestions are very welcome:

gmt begin left-annots png

  gmt basemap -R0/1000/0/1000 -JX5c -Bwsne -Bpy500f -Bpx500f
#Y annots on the right
  gmt text -F+fred+jML -Dj6p -N << EOF
1000 0 0
1000 500 500
1000 1000 1000
EOF

gmt end show

See the red-colored left-aligned Y axis annotations:
Image

Activity

  1. mkononets
    added
    feature requestRequest a new feature
    on Mar 28, 2026
  2. mkononets
    changed the title [-]Left-aligned annotations for the secondary Y axis?[/-] [+]Left-aligned annotations for the secondary Y axis and colorbars?[/+] on Mar 28, 2026
  3. mkononets
    changed the title [-]Left-aligned annotations for the secondary Y axis and colorbars?[/-] [+]Left-aligned annotations for the right-side Y axes and colorbars?[/+] on Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest a new feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.