-=head1 NOTES on legend arguments
-
-=head2 Escaping the colon
-
-In a ':' in a I<legend> argument will mark the end of the legend. To
-enter a ':' into a legend, the colon must be escaped with a backslash '\:'.
-Beware, that many environments look for backslashes themselves, so it may
-be necessary to write two backslashes so that one is passed onto rrd_graph.
-
-=head2 String Formatting
-
-The text printed below the actual graph can be formated by appending special
-escaped characters at the end of a text. When ever such a character occurs,
-all pending text is pushed onto the graph according to the character
-specified.
-
-Valid markers are: B<\j> for justified, B<\l> for left aligned, B<\r> for
-right aligned and B<\c> for centered. In the next section there is an
-example showing how to use centered formating.
-
-Normally there are two space characters inserted between every two items
-printed into the graph. The space following a string can be suppressed by
-putting a B<\g> at the end of the string. The B<\g> also squshes any space
-inside the string if it is at the very end of the string. This can be used
-in connection with B<%s> to supress empty unit strings.
-
- GPRINT:a:MAX:%lf%s\g
-
-A special case is COMMENT:B<\s> this inserts some additional vertical space
-before placing the next row of legends.
-
-=head1 NOTE on Return Values
-
-Whenever rrd_graph gets called, it prints a line telling the size of
-the gif it has just created to STDOUT. This line looks like this: XSIZExYSIZE.
-
-=head1 EXAMPLE 1
-
- rrdtool graph demo.gif --title="Demo Graph" \
- DEF:cel=demo.rrd:exhaust:AVERAGE \
- "CDEF:far=cel,1.8,*,32,+"" \
- LINE2:cel#00a000:"D. Celsius" \
- LINE2:far#ff0000:"D. Fahrenheit\c"
-
-=head1 EXAMPLE 2
-
-This example demonstrates the syntax for using IF and UN to set
-I<*UNKNOWN*> values to 0. This technique is useful if you are
-aggregating interface data where the start dates of the data sets
-doesn't match.
-
- rrdtool graph demo.gif --title="Demo Graph" \
- DEF:idat1=interface1.rrd:ds0:AVERAGE \
- DEF:idat2=interface2.rrd:ds0:AVERAGE \
- DEF:odat1=interface1.rrd:ds1:AVERAGE \
- DEF:odat2=interface2.rrd:ds1:AVERAGE \
- CDEF:agginput=idat1,UN,0,idat1,IF,idat2,UN,0,idat2,IF,+,8,* \
- CDEF:aggoutput=odat1,UN,0,odat1,IF,odat2,UN,0,odat2,IF,+,8,* \
- AREA:agginput#00cc00:Input Aggregate \
- LINE1:agginput#0000FF:Output Aggregate
-
-Assuming that idat1 has a data value of I<*UNKNOWN*>, the CDEF expression
-
- idat1,UN,0,idat1,IF
-
-leaves us with a stack with contents of 1,0,NaN and the IF function
-will pop off the 3 values and replace them with 0. If idat1 had a
-real value like 7942099, then the stack would have 0,0,7942099 and the
-real value would be the replacement.
-
-=head1 EXAMPLE 3
-
-This example shows two ways to use the INF function. First it makes
-the background change color during half of the hours. Then, it uses
-AREA and STACK to draw a picture. If one of the inputs was UNKNOWN,
-all inputs are overlaid with another AREA.
-
- rrdtool graph example.png --title="INF demo" \
- DEF:val1=some.rrd:ds0:AVERAGE \
- DEF:val2=some.rrd:ds1:AVERAGE \
- DEF:val3=some.rrd:ds2:AVERAGE \
- DEF:val4=other.rrd:ds0:AVERAGE \
- CDEF:background=val4,POP,TIME,7200,%,3600,LE,INF,UNKN,IF \
- CDEF:wipeout=val1,val2,val3,val4,+,+,+,UN,INF,UNKN,IF \
- AREA:background#F0F0F0 \
- AREA:val1#0000FF:Value1 \
- STACK:val2#00C000:Value2 \
- STACK:val3#FFFF00:Value3 \
- STACK:val4#FFC000:Value4 \
- AREA:wipeout#FF0000:Unknown
-
-The first CDEF uses val4 as a dummy value. It's value is removed immediately
-from the stack. Then a decision is made based on the time that a sample was
-taken. If it is an even hour (UTC time !) then the area will be filled. If
-it is not, the value is set to UNKN and is not plotted.
-
-The second CDEF looks if any of val1,val2,val3,val4 is unknown. It does so by
-checking the outcome of sum(val1,val2,val3,val4). Again, INF is returned when
-the condition is true, UNKN is used to not plot the data.
-
-The different items are plotted in a particular order. First do the background, then use a
-normal area to overlay it with data. Stack the other data until they are all plotted. Last but
-not least, overlay everything with eye-hurting red
-to signal any unknown data.
-
-Note that this example assumes that your data is in the positive half of the y-axis
-otherwhise you would would have to add NEGINF in order to extend the coverage
-of the rea to whole graph.
-
-=head1 EXAMPLE 4
-
-If the specialized function B<RRAs> exist for aberrant behavior detection, they
-can be used to generate the graph of a time series with confidence bands and
-failures.
-
- rrdtool graph example.gif \
- DEF:obs=monitor.rrd:ifOutOctets:AVERAGE \
- DEF:pred=monitor.rrd:ifOutOctets:HWPREDICT \
- DEF:dev=monitor.rrd:ifOutOctets:DEVPREDICT \
- DEF:fail=monitor.rrd:ifOutOctets:FAILURES \
- TICK:fail#ffffa0:1.0:"Failures\: Average bits out" \
- CDEF:scaledobs=obs,8,* \
- CDEF:upper=pred,dev,2,*,+ \
- CDEF:lower=pred,dev,2,*,- \
- CDEF:scaledupper=upper,8,* \
- CDEF:scaledlower=lower,8,* \
- LINE2:scaledobs#0000ff:"Average bits out" \
- LINE1:scaledupper#ff0000:"Upper Confidence Bound: Average bits out" \
- LINE1:scaledlower#ff0000:"Lower Confidence Bound: Average bits out"
-
-This example generates a graph of the data series in blue (LINE2 with the scaledobs
-virtual data source), confidence bounds in red (scaledupper and scaledlower virtual
-data sources), and potential failures (i.e. potential aberrant aberrant behavior)
-marked by vertical yellow lines (the fail data source).
-
-The raw data comes from an AVERAGE B<RRA>, the finest resolution of the observed
-time series (one consolidated data point per primary data point). The predicted
-(or smoothed) values are stored in the HWPREDICT B<RRA>. The predicted deviations
-(think standard deviation) values are stored in the DEVPREDICT B<RRA>. Finally,
-the FAILURES B<RRA> contains indicators, with 1 denoting a potential failure.
-
-All of the data is rescaled to bits (instead of Octets) by multiplying by 8.
-The confidence bounds are computed by an offset of 2 deviations both above
-and below the predicted values (the CDEFs upper and lower). Vertical lines
-indicated potential failures are graphed via the TICK graph element, which
-converts non-zero values in an B<RRA> into tick marks. Here an axis-fraction
-argument of 1.0 means the tick marks span the entire y-axis, and hence become
-vertical lines on the graph.
-
-The choice of 2 deviations (a scaling factor) matches the default used internally
-by the FAILURES B<RRA>. If the internal value is changed (see L<rrdtune>), this
-graphing command should be changed to be consistent.
-
-=head2 A note on data reduction:
-
-The B<rrdtool> I<graph> command is designed to plot data at a specified temporal
-resolution, regardless of the actually resolution of the data in the RRD file.
-This can present a problem for the specialized consolidation functions which
-maintain a one-to-one mapping between primary data points and consolidated
-data points. If a graph insists on viewing the contents of these B<RRAs> on a
-coarser temporal scale, the I<graph> command tries to do something intelligent,
-but the confidence bands and failures no longer have the same meaning and may
-be misleading.