From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Chart::Graph::xrt()</TITLE>
<LINK REV=MADE HREF="mailto:mhyoung%40caida.org">
</HEAD>
<BODY BGCOLOR="white">
<a href="http://www.caida.org"> <img alt="Cooperative Association for Internet Data Analysis" SRC="http://www.caida.org/images/CAIDAlogo_small.gif" width=105 height=137 border=0 align="left"></a>
<table border=0 cellspacing=0 cellpadding=50 width="80%">
<tr>
<td>
<CENTER><H1>Chart::Graph::xrt()</H1></CENTER>
</td>
</tr>
</table>
<br>
<hr>
<UL>
<LI><A HREF="#Description">Description</A></LI>
<LI><A HREF="#Calling xrt()">Calling xrt()</A></LI>
<LI><A HREF="#Arguments">Arguments</A></LI>
<LI><A HREF="#Example">Example</A></LI></UL>
<HR>
<H2><A NAME="Description">Description</A></H2>
<P>
<B>xrt()</B> is a function in module Chart::Graph that lets you
generate graphs on the fly in perl. It was written as a front-end
application to gnuplot for hassle-free generation of graphs. You
would normally use xrt to generate 3D graphs.
</P>
<HR>
<H2><A NAME="Calling xrt()">Calling xrt()</A></H2>
<pre>
#make sure to include Chart::Graph
use Chart::Graph;
xrt(\%options, \@data_set);
#say for example we have a 3 by 4 matrix -> dataxy
xrt(\%options,
[[data11, data12, data13, data14],
[data21, data22, data23, data24],
[data31, data32, data33, data34]])
</pre>
<HR>
<H2><A NAME="Arguments">Arguments</A></H2>
<P>
<I>%options</I>
<TABLE BORDER="1">
<TR><TD><B>Name</B></TD> <TD><B>Options</B></TD> <TD><B>Default</B></TD></TR>
<TR><TD>"output file"</TD> <TD>(set your own)</TD> <TD>"xrt.gif"</TD></TR>
<TR><TD>"x-axis title"</TD> <TD>(set your own)</TD> <TD>"x-axis"</TD></TR>
<TR><TD>"y-axis title"</TD> <TD>(set your own)</TD> <TD>"y-axis"</TD></TR>
<TR><TD>"z-axis title"</TD> <TD>(set your own)</TD> <TD>"z-axis"</TD></TR>
<TR><TD>"x-min"</TD> <TD>"0" or "1"(normally 0)</TD> <TD>"0"</TD></TR>
<TR><TD>"y-min"</TD> <TD>"0" or "1"(normally 0)</TD> <TD>"0"</TD></TR>
<TR><TD>"x-step"</TD> <TD>"0" or "1"(normally 1)</TD> <TD>"1"</TD></TR>
<TR><TD>"y-step"</TD> <TD>"0" or "1"(normally 1)</TD> <TD>"1"</TD></TR>
<TR><TD>"x-ticks"</TD> <TD>(set your own)</TD> <TD>none</TD></TR>
<TR><TD>"y-ticks"</TD> <TD>(set your own)</TD> <TD>none</TD></TR>
<TR><TD>"header"</TD> <TD>(set your own)</TD> <TD>"header"</TD></TR>
<TR><TD>"footer"</TD> <TD>(set your own)</TD> <TD>"footer"</TD></TR>
</TABLE>
<BR>
<I>\@data_set:</I> an x by y matrix of doubles-- see example for syntax<HR>
<H2><A NAME="Example">Example</A></H2>
<pre>
#make sure to include Chart::Graph
use Chart::Graph;
#using a 3 by 4 matrix for the data set
xrt({"x-ticks"=>["a", "b", "c"],
"y-ticks"=>["w", "x", "y", "z"],},
[["10", "15", "23", "10"],
["4", "13", "35", "45"],
["29", "15", "64", "24"]]);
</pre>
<IMG BORDER="1" SRC="xrt.gif" ALT="Graph of eample using xrt"><HR>
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD ALIGN="LEFT">
<I> for more information: </I>
&nbsp;
info @ caida.org
</TD>
<TD ALIGN="RIGHT">
<I> last update: </I>
&nbsp;
<SCRIPT>
<!--
document.write(document.lastModified);
// -->
</SCRIPT>
</TD>
</TR>
<TR>
<TD ALIGN="CENTER" COLSPAN=2>
<I> this page: </I>
&nbsp;
<SCRIPT>
<!--
document.write(document.location);
// -->
</SCRIPT>
<A HREF="http://validator.w3.org/check?url=http://www.caida.org/~mhyoung/graph/graph_xrt.html;weblint;outline"><IMG ALIGN="right" BORDER="0" WIDTH="88" SRC="http://validator.w3.org/images/vh32.gif" HEIGHT="31" ALT="Valid HTML 32"></A>
</TD>
</TR>
</TABLE>
</body>
</html>