gmt
gmt copied to clipboard
Let pshistogram handle both Cartesian and polar histograms
Description of the desired feature
The psrose module is very old (2.4.1) and has a checkered history:
- It started off life not using -J but had a -Sradius option.
- The -R option is backwards [-Rr0/r1/theta0/theta1] relative to other azimuthal plots.
- Because not implemented as a projection we cannot use the -B machinery so any annotation problem requires fixes to the module itself.
- In GMT 5 we added -JXdiameter (as if this is a square Cartesian projection) because it would give the appearance of using -J.
- Elsewhere in GMT, we use have the polar cylindrical projection -JP with proper -B support, and here -R is properly given as -Rtheta0/theta1/r0/r1.
It is too late to fix the way psrose works. I propose this solution to address all the wrong things in psrose as well as enable future features:
- Add the polar histogram to pshistogram via -JP. Then -JX sets the Cartesian histogram and -JP does the polar. Both projections have proper -R and -B support.
- Deprecate psrose so it is no longer discussed but it will remain available under the hood for backwards usage.
Accepting comments from @GenericMappingTools/core.
Sound good!! I agree that psrose could be upgrade.
A few questions:
- Would all capabilities currently supported by psrose be possible with pshistogram -JP? (e.g., -E, -Q, -S)
- In the proposed merge of histogram and rose, would histograms representing multiple dimensions be a reasonable feature request (e.g., https://forum.generic-mapping-tools.org/t/plotting-a-wind-rose-2d-histogram-style/2415)? I agree with the author of that post in this being a major limitation of psrose.
Linking @GenericMappingTools/pygmt-maintainers into the conversation, since this would likely lead to a PyGMT deprecation as well.
It is true that rose has a few options specific to polar histogram and of course those letters are already taken for other things in histogram. I will go through all options and see what collisions we end up.
I don't think deprecating psrose, even if leaving it crawling in the underground, is a good idea. People would start (and keep) asking what happened to it. Better just leave it as is and adding a big deprecation in the man page (but not necessarily in the binary).
To be discussed I think. We could even have a redirecting psrose page that explains why and gives the link to pshistogram. for instance.
The binning radially is also a desirable feature for Cartesian histograms, we will do that for both types.