[Graph-dev] are parametric equations possible using Chart::Graph?

Emile Aben emile at caida.org
Mon Jun 5 09:20:16 PDT 2006


On Sun, Jun 04, 2006 at 06:26:13PM -0500, Nancy Noell Burk wrote:
> Hi.
> 
> Is it possible to graph parametric equations using Chart::Graph as 
> described here: http://www.cs.uni.edu/Help/gnuplot/parametric.html for 
> GnuPlot?
> 
> Thanks in advance!

Hi Nancy,

the 'extra_opts' parameter in Chart::Graph::gnuplot gives
you the freedom to add some options needed for
the parametric functions. For instance:

use Chart::Graph qw(gnuplot);
gnuplot({
        'title' => 'parametric example',
        'output file' => 'plot.png',
        'extra_opts' => ['set parametric','set trange [0:10]'],
    },
    [
	{ 'title' => 'fnc 1',
          'type' => 'function',
        },
        '5*cos(t), 2*sin(t)',
    ],
    [   
        { 'title' => 'data',
          'type' => 'matrix', 
        },
        [ 
          [ 0, 1], 
          [ 1, 5], 
          [ 2,-1] 
        ]
    ]
);

3D parametric plots are not possible with the current version of Chart::Graph::gnuplot().

hope this helps,

Emile Aben
CAIDA/SDSC/UCSD

 



More information about the Graph-dev mailing list