Cacti (home)ForumsDocumentation

Differences

This shows you the differences between two versions of the page.

manual:100:8_rrdtool.06_alt_y_grid [2019/10/29 15:16] (current)
Line 1: Line 1:
 +===== Change y-Axis Scaling =====
  
 +This example has been taken from a discussion at rrdtool-users mailing list. It tackles a scenario, where barometric pressure values only differ by a very small number between polling cycles.
 +//Examples are done using rrdtool 1.3.8//
 +
 +Let me show you a set of numbers to demonstrate how it may look like without paying special attention:
 +
 +<code>rrdtool create test.rrd --start 1245448800 DS:test:GAUGE:300:U:U RRA:AVERAGE:0:1:10
 +
 +rrdtool update test.rrd 1245449100:29.97
 +rrdtool update test.rrd 1245449400:29.96
 +rrdtool update test.rrd 1245449700:29.95
 +rrdtool update test.rrd 1245450000:29.94
 +rrdtool update test.rrd 1245450300:29.95
 +rrdtool update test.rrd 1245450600:29.96
 +rrdtool update test.rrd 1245450900:29.97
 +rrdtool update test.rrd 1245451200:29.98
 +rrdtool update test.rrd 1245451500:29.99
 +
 +rrdtool graph test.png --start 1245448800 --end 1245451500 \
 +        --title "native autoscaling looks ugly" \
 +        --alt-autoscale \
 +        DEF:test=test.rrd:test:AVERAGE \
 +        LINE1:test#FF0000:test
 +</code>
 +
 +Here's the result:
 +
 +{{:manual:087:autscale.png|Native autoscaling looks ugly}}
 +
 +You now may want to use **--alt-y-grid**. Not a bad idea, but lets look how it goes:
 +<code>rrdtool create test.rrd --start 1245448800 DS:test:GAUGE:300:U:U RRA:AVERAGE:0:1:10
 +
 +rrdtool update test.rrd 1245449100:29.97
 +rrdtool update test.rrd 1245449400:29.96
 +rrdtool update test.rrd 1245449700:29.95
 +rrdtool update test.rrd 1245450000:29.94
 +rrdtool update test.rrd 1245450300:29.95
 +rrdtool update test.rrd 1245450600:29.96
 +rrdtool update test.rrd 1245450900:29.97
 +rrdtool update test.rrd 1245451200:29.98
 +rrdtool update test.rrd 1245451500:29.99
 +
 +rrdtool graph test.png --start 1245448800 --end 1245451500 \
 +        --title "autoscaling and alt-y-grid is better" \
 +        --alt-autoscale \
 +        --alt-y-grid \
 +        DEF:test=test.rrd:test:AVERAGE \
 +        LINE1:test#FF0000:test
 +</code>
 +And, again, the result:
 +
 +{{:manual:087:alt_y_grid.png|autoscaling and alt-y-grid is better}}
 +
 +The numbers on the y-axis are adjusted better. But there's more improvement achievable. Let's add the **--rigid** option:
 +<code>rrdtool create test.rrd --start 1245448800 DS:test:GAUGE:300:U:U RRA:AVERAGE:0:1:10
 +
 +rrdtool update test.rrd 1245449100:29.97
 +rrdtool update test.rrd 1245449400:29.96
 +rrdtool update test.rrd 1245449700:29.95
 +rrdtool update test.rrd 1245450000:29.94
 +rrdtool update test.rrd 1245450300:29.95
 +rrdtool update test.rrd 1245450600:29.96
 +rrdtool update test.rrd 1245450900:29.97
 +rrdtool update test.rrd 1245451200:29.98
 +rrdtool update test.rrd 1245451500:29.99
 +
 +rrdtool graph test.png --start 1245448800 --end 1245451500 \
 +        --title "autoscaling, alt-y-grid and rigid is perfect" \
 +        --alt-autoscale \
 +        --alt-y-grid \
 +        --rigid \
 +        DEF:test=test.rrd:test:AVERAGE \
 +        LINE1:test#FF0000:test
 +</code>
 +This now results in:
 +
 +{{:manual:087:alt_y_grid_rigid.png|autoscaling, alt-y-grid and rigid is perfect}}
 +
 +which is quite acceptable.





Personal Tools