rrdtool-1.x icon indicating copy to clipboard operation
rrdtool-1.x copied to clipboard

Graphs can show meaningless annotations

Open ralphrmartin opened this issue 4 years ago • 6 comments

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

Screenshot 2020-04-18 at 19 41 00

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.

ralphrmartin avatar Apr 18 '20 18:04 ralphrmartin

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?

yrebrac avatar Jan 31 '21 13:01 yrebrac

Seems to help

ralphrmartin avatar Jan 31 '21 18:01 ralphrmartin

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]

yrebrac avatar Feb 02 '21 09:02 yrebrac

Doubtless both of the suggestions make useful workarounds - thanks. The real point though is that the automatic method is somewhat broken.

ralphrmartin avatar Feb 02 '21 14:02 ralphrmartin

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).

yrebrac avatar Feb 03 '21 01:02 yrebrac

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).

vinc17fr avatar Jan 03 '22 21:01 vinc17fr