rrdtool-1.x
rrdtool-1.x copied to clipboard
Graphs can show meaningless annotations
Describe the bug When values being plotted are similar, sometimes the axis legend is unhelpful, showing the same integer value at two different hieghts. See attached example.
To Reproduce Make a plot with similar values.
Expected behavior Enough decimal places shown on axis labelling to make the scale clear.
Screenshots
Desktop (please complete the following information): Chrome on MacOS.
Smartphone (please complete the following information): N/A
Additional context Add any other context about the problem here.
Interesting one. The scaling of the overall graph is done to fit the line, but I've never noticed a problem with axes before. This might be an edge case because of the particular values on this graph.
Out of curiosity, what happens if you change your GPRINT to 2 dp. Does the axis change?
Seems to help
I just noticed there are in fact some options for controlling the scale of the axes. See https://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html, from Limits section. You could try the this option for example.
[-y|--y-grid grid step:label factor]
Doubtless both of the suggestions make useful workarounds - thanks. The real point though is that the automatic method is somewhat broken.
Right but if you read the doco link I provided you will see it is a known issue, and a user contributed the alternate switch, so unlikely to be fixed at this point (unless you decide to offer some code - that's how OS works)).
[-A|--alt-autoscale]
Sometimes the default algorithm for selecting the y-axis scale is not satisfactory. Normally the scale is selected from a predefined set of ranges and this fails miserably when you need to graph something like 260 + 0.001 * sin(x). This option calculates the minimum and maximum y-axis from the actual minimum and maximum data values. Our example would display slightly less than 260-0.001 to slightly more than 260+0.001 (this feature was contributed by Sasha Mikheev).
Here, the graph is scaled correctly. It is --alt-y-grid
that should be needed (but I'm wondering why this is not used by default).