Left-aligned annotations for the right-side Y axes and colorbars?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- c
- Domain
- data-visualization
Research direction
Start by reproducing the examples with gmt basemap, gmt colorbar, and gmt text, then trace the existing right-side axis and colorbar annotation handling. Done means right-side Y-axis and colorbar annotations are left-aligned consistently, including the requested treatment of negative values, with behavior verified against the demonstrated cases.
Written by the indexing model from the issue text.
Description
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
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:
- Dominant language
- C
- Stars
- 997
- Forks
- 420
- Avg merge
- 13h 27m
- Merged PRs (30d)
- 47
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GenericMappingTools/gmt
-
Add support for SCM 9.0.0 to GMTPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
GenericMappingTools/gmt#9316 · 10 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
GenericMappingTools/gmt#5767 · 15 comments ·
Maintainers usually reply within 1 day
-
discussion
Difficulty 5/5 Over a week Newbie friendliness 35/100
GenericMappingTools/gmt#9343 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
GenericMappingTools/gmt#9331 · 1 reaction ·
Maintainers usually reply within 1 day
-
histogram: the min/max setting in -T is ignored when -R is setPossibly taken @seisman claimed this 1 day ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
GenericMappingTools/gmt#9330 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in GenericMappingTools/gmt
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Broken links in reference manualPossibly taken @farisbasha claimed this 14 days ago. Opencore:meson
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mpv-player/mpv#18934 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
libsndfile/libsndfile#1239 ·