The Chart::Graph:Gnuplot global option is format, and it takes a two element array reference: the axis to be plotted and the format string. Certainly, representing dates as numerically is probably the most conservative.Ĭreating date/time labels for any of the axes is basically analogous. Note that while the month and month abbreviation can be accepted, any other text must be matched (excluded) in the timefmt string. The timefmt string required would be: "%d/%m/%y %H:%M:%S". So for example, x-y data can be specified in columns like this: 03:05:39 2.05e-5 However, Gnuplot does recognize white space specified in the timefmt string. Gnuplot normally uses whitespace to separate datasets. %b requires three characters, and %B requires as many as it needs." Gnuplot uses the space character as white space pattern match - essentially the same as Perl's: \s*. ![]() If there is no separating character between the time/date elements, then %d, %m, %y, %H, %M and %S read two digits each, %Y reads four digits and %j reads three digits. Backslash-octals ( \nnn) are converted to char. To quote from Gnuplot manual: "Any character is allowed in the string, but must match exactly. ![]() In addition there are some additional special cases for reading date/time data. | %b | three-character abbreviation of the name of the month | Gnuplot uses the same format codes for date/time input and output so the following table applies to both situations. The timefmt command takes a string consisting of the elements noted below. The input format is set using the timefmt command noted above. Unfortunately, you can set only one format to read your data therefore, consistency is advised. This is done by setting the options xdata, ydata, x2data, or y2data to the value time. Chart::Graph::Gnuplot implements date/time data in the same way as Gnuplot itself is presently implemented for consistency with the application.Īny axis can be set to read date/time data instead of numerical data. Unfortunately, mechanism for reading data is less sophisticated than the mechanism for writing data. Gnuplot now has the capability to read date/time data and to create graphs which display date/time on any axis. USING GNUPLOT TO READ AND PLOT DATE/TIME DATA DIRECTLY is the y-axis data.įinally, data can be stored in a file. | 'using' | map data to what will be | '1:2' |ĭata can be presented to Chart::Graph::Gnuplot in one of 3 formats for the convenience of the user: an array reference of pairs of dataĪlternatively: two array references of data of equal is the x-axis data. | 'style' | 'points','lines','impulses' | 'points' | | 'title' | set your own title | 'untitled data' | | 'type' | 'matrix', 'columns', 'file',| none | | 'size' | scale the display size of | none | | 'extra_opts' | set your own Gnuplot | none | | 'format' | array ref: First element is | | | 'timefmt' | "Input date/time string" | none | | 'y2data' | 'time' to indicate that | none | | 'x2data' | 'time' to indicate that | none | | 'ydata' | 'time' to indicate that | none | | 'xdata' | 'time' to indicate that | none | | 'uts' | set your own range in unix | none | | 'yrange' | set yrange, see xrange | none | | 'xrange' | set xrange, accepts both | none | | 'y2tics' | set your own tics on y2-axis| none | | 'ytics' | set your own tics on y-axis | none | | 'x2tics' | set your own tics on x2-axis| none | | 'xtics' | set your own tics on x-axis | none | |'y2-axis label' | set your own label | none | |'x2-axis label' | set your own label | none | |'y-axis label' | set your own label | 'y-axis' | |'x-axis label' | set your own label | 'x-axis' | |'output file' | set your own output file, | 'untitled-gnuplot.png' | |'title' | set your own title | 'untitled' | ![]() This Perl wrapper provides a large subset of the functionality of the application. Gnuplot() has a very large number of options corresponding to options available with the gnuplot application itself. For more information on gnuplot see the end of this section. gnuplot() can be supplied with many of the same options and arguments that can be given to gnuplot. It was written as a front-end application to gnuplot for hassle-free generation of graphs. Gnuplot() is a function in module Chart::Graph that lets you generate graphs on the fly in perl.
0 Comments
Leave a Reply. |