Specify the number of tick marks in a color bar?
ScottLindstrom opened this issue · 4 comments
--colorbar-tick-marks doesn't work in Geo2Grid as I expect it to. (This is a documentation issue)
The documentation says: Tick interval in Data units (default 5).
But what it actually means: Label every 5th tick mark. I was trying to decrease the number of ticks plotted from 255, to, like, every 5th or 10th tick.
There doesn't seem to be a --command to decrease the number of ticks (labeled or not)
Yep, it looks like you're right. I think this stems from me misreading the upstream code in the pycoast
package. It calls a function with the minimum value of the colorbar, the maximum value, and "tick_marks". I assumed it was spacing the colorbar ticks by "tick_marks" data values, but it is splitting the min->max range to produce "tick_marks" number of ticks...I think.
The number of tick marks never changes, I think it's stuck at 255. It's just which nth tick mark is labeled is what is being controlled. --colorbar-tick-marks 10 labels every 10th tickmark.
Looking at the pydecorate
(I was wrong, pycoast isn't the package drawing the colorbar, pydecorate is) that there is a concept of "minor" ticks. This may be the difference between the ticks that aren't going away and the ticks that get labels. There is no control of minor ticks in G2G/P2G right now.
I just did a few tests and this kind of makes sense. The --colorbar-tick-marks
is used for the spacing of the major ticks in data units, but only the major ticks are labeled. The minor_tick_marks
keyword argument in the library controls the data spacing of the minor ticks which is what you're seeing as the ones that won't go away. Like I said there is no controlling those in the current script so I'll have to add it.