<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Plot</TITLE> <META NAME="description" CONTENT="Plot"> <META NAME="keywords" CONTENT="gnuplot"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="gnuplot.css"> <LINK REL="next" HREF="node166.html"> <LINK REL="previous" HREF="node112.html"> <LINK REL="up" HREF="node88.html"> <LINK REL="next" HREF="node114.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html2591" HREF="node114.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html2585" HREF="node88.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html2579" HREF="node112.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html2587" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html2589" HREF="node467.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html2592" HREF="node114.html">Axes</A> <B> Up:</B> <A NAME="tex2html2586" HREF="node88.html">Commands</A> <B> Previous:</B> <A NAME="tex2html2580" HREF="node112.html">Pause</A> <B> <A NAME="tex2html2588" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html2590" HREF="node467.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION040140000000000000000"></A> <A NAME="commands_plot"></A><A NAME="plot"></A><A NAME="2550"></A> <BR> Plot </H1> <B>plot</B> is the primary command for drawing plots with <B>gnuplot</B>. It creates plots of functions and data in many, many ways. <B>plot</B> is used to draw 2-d functions and data; <B>splot</B> draws 2D projections of 3D surfaces and data. <B>plot</B> and <B>splot</B> contain many common features; see <B>splot (p. <A HREF="node335.html#splot"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="2558"></A></B> for differences. Note specifically that although the <B>binary 4#4binary list5#5</B> variation does work for both <B>plot</B> and <B>splot</B>, there are small differences between these modes. <P> Syntax: <BR> <PRE> plot {<ranges>} {<iteration>} {<function> | {"<datafile>" {datafile-modifiers}}} {axes <axes>} {<title-spec>} {with <style>} {, {definitions{,}} <function> ...} </PRE> <BR> <P> where either a 4#4function5#5 or the name of a data file enclosed in quotes is supplied. A function is a mathematical expression or a pair of mathematical expressions in parametric mode. The expressions may be defined completely or in part earlier in the stream of <B>gnuplot</B> commands (see <B>user-defined (p. <A HREF="node31.html#user-defined"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="2566"></A></B>). <P> It is also possible to define functions and parameters on the <B>plot</B> command itself. This is done merely by isolating them from other items with commas. <P> Examples: <BR> <PRE> plot sin(x) plot sin(x), cos(x) plot f(x) = sin(x*a), a = .2, f(x), a = .4, f(x) plot "datafile.1" with lines, "datafile.2" with points plot [t=1:10] [-pi:pi*2] tan(t), \ "data.1" using (tan($2)):($3/$4) smooth csplines \ axes x1y2 notitle with lines 5 plot for [datafile in "spinach.dat broccoli.dat"] datafile </PRE> <BR> <P> See also <B>show plot (p. <A HREF="node244.html#show_plot"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="2571"></A></B>. <BR><HR> <!--Table of Child-Links--> <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> <UL> <LI><A NAME="tex2html2593" HREF="node114.html">Axes</A> <LI><A NAME="tex2html2594" HREF="node115.html">Data</A> <UL> <LI><A NAME="tex2html2595" HREF="node116.html">Binary</A> <LI><A NAME="tex2html2596" HREF="node117.html">Binary general</A> <UL> <LI><A NAME="tex2html2597" HREF="node118.html">Array</A> <LI><A NAME="tex2html2598" HREF="node119.html">Record</A> <LI><A NAME="tex2html2599" HREF="node120.html">Skip</A> <LI><A NAME="tex2html2600" HREF="node121.html">Format</A> <LI><A NAME="tex2html2601" HREF="node122.html">Endian</A> <LI><A NAME="tex2html2602" HREF="node123.html">Filetype</A> <UL> <LI><A NAME="tex2html2603" HREF="node124.html">Avs</A> <LI><A NAME="tex2html2604" HREF="node125.html">Edf</A> <LI><A NAME="tex2html2605" HREF="node126.html">Png</A> </UL> <LI><A NAME="tex2html2606" HREF="node127.html">Keywords</A> <UL> <LI><A NAME="tex2html2607" HREF="node128.html">Scan</A> <LI><A NAME="tex2html2608" HREF="node129.html">Transpose</A> <LI><A NAME="tex2html2609" HREF="node130.html">Dx, dy, dz</A> <LI><A NAME="tex2html2610" HREF="node131.html">Flipx, flipy, flipz</A> <LI><A NAME="tex2html2611" HREF="node132.html">Origin </A> <LI><A NAME="tex2html2612" HREF="node133.html">Center</A> <LI><A NAME="tex2html2613" HREF="node134.html">Rotate</A> <LI><A NAME="tex2html2614" HREF="node135.html">Perpendicular</A> </UL> <LI><A NAME="tex2html2615" HREF="node136.html">Binary examples</A> </UL> <LI><A NAME="tex2html2616" HREF="node137.html">Every</A> <LI><A NAME="tex2html2617" HREF="node138.html">Example datafile</A> <LI><A NAME="tex2html2618" HREF="node139.html">Index</A> <LI><A NAME="tex2html2619" HREF="node140.html">Smooth</A> <UL> <LI><A NAME="tex2html2620" HREF="node141.html">Acsplines</A> <LI><A NAME="tex2html2621" HREF="node142.html">Bezier</A> <LI><A NAME="tex2html2622" HREF="node143.html">Csplines</A> <LI><A NAME="tex2html2623" HREF="node144.html">Sbezier</A> <LI><A NAME="tex2html2624" HREF="node145.html">Unique</A> <LI><A NAME="tex2html2625" HREF="node146.html">Frequency</A> <LI><A NAME="tex2html2626" HREF="node147.html">Cumulative</A> <LI><A NAME="tex2html2627" HREF="node148.html">Kdensity</A> </UL> <LI><A NAME="tex2html2628" HREF="node149.html">Special-filenames</A> <LI><A NAME="tex2html2629" HREF="node150.html">Thru</A> <LI><A NAME="tex2html2630" HREF="node151.html">Using</A> <UL> <LI><A NAME="tex2html2631" HREF="node152.html">Using_examples</A> <LI><A NAME="tex2html2632" HREF="node153.html">Pseudocolumns</A> <LI><A NAME="tex2html2633" HREF="node154.html">Xticlabels</A> <LI><A NAME="tex2html2634" HREF="node155.html">X2ticlabels</A> <LI><A NAME="tex2html2635" HREF="node156.html">Yticlabels</A> <LI><A NAME="tex2html2636" HREF="node157.html">Y2ticlabels</A> <LI><A NAME="tex2html2637" HREF="node158.html">Zticlabels</A> </UL> </UL> <BR> <LI><A NAME="tex2html2638" HREF="node159.html">Errorbars</A> <LI><A NAME="tex2html2639" HREF="node160.html">Errorlines</A> <LI><A NAME="tex2html2640" HREF="node161.html">Parametric</A> <LI><A NAME="tex2html2641" HREF="node162.html">Ranges</A> <LI><A NAME="tex2html2642" HREF="node163.html">Iteration</A> <LI><A NAME="tex2html2643" HREF="node164.html">Title</A> <LI><A NAME="tex2html2644" HREF="node165.html">With</A> </UL> <!--End of Table of Child-Links--> <HR> <!--Navigation Panel--> <A NAME="tex2html2591" HREF="node114.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html2585" HREF="node88.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html2579" HREF="node112.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html2587" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html2589" HREF="node467.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html2592" HREF="node114.html">Axes</A> <B> Up:</B> <A NAME="tex2html2586" HREF="node88.html">Commands</A> <B> Previous:</B> <A NAME="tex2html2580" HREF="node112.html">Pause</A> <B> <A NAME="tex2html2588" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html2590" HREF="node467.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2010-08-17 </ADDRESS> </BODY> </HTML>