IUP
view release on metacpan or search on metacpan
lib/IUP/MglPlot.pod view on Meta::CPAN
=head3 PlotInsert3D()
$plot->PlotInsert3D($index, $sample_index, \@x, \@y, \@z);
See L<PlotInsert2D|/"PlotInsert2D()">.
=head3 PlotSet1D()
$plot->PlotSet1D($index, \@name, \@y);
See L<PlotSet2D|/"PlotSet2D()">.
=head3 PlotSet2D()
$plot->PlotSet2D($index, \@x, \@y);
Sets an array of samples in the dataset B<ds_index>. Existing data is
removed. Can be used only after the dataset is added to the plot.
For 1D version B<name> is an optional array of strings used for tick labels in the X
axis, and it can be C<undef>. Names are allowed only for the
first dataset and when set ticks configuration for the X axis is
ignored, all the names are shown. Also for the 1D version, the X axis
data is automatically generated (0,1,2,3,...). I<Linear data only.>
=head3 PlotSet3D()
$plot->PlotSet3D($index, \@x, \@y, \@z);
See L<PlotSet2D|/"PlotSet2D()">.
=head3 PlotTransform()
($ix, $iy) = $plot->PlotTransform($x, $y, $z);
Converts coordinates from plot coordinates to pixels. It can be used
only inside PREDRAW_CB and POSTDRAW_CB callbacks. Output variables can
be C<undef> if not used.
=head3 PlotTransformTo()
($x, $y, $z) = $plot->PlotTransformTo($ix, $iy);
Converts coordinates from pixels to plot coordinates. It can be used
only inside PREDRAW_CB and POSTDRAW_CB callbacks. Output variables can
be C<undef> if not used.
=head3 PlotPaintTo()
$plot->PlotPaintTo($filename);
#or
$plot->PlotPaintTo($filename, $width, $height, $dpi);
Plots to a vector imagefile instead of the display canvas. Note: only *.SVG and *.EPS formats are supported.
B<$width> and B<$height> is the size in pixels, and B<$dpi> is the resolution in dots or pixels per inch.
If B<width>, B<$height> or B<$dpi> are 0 the screen equivalent is used.
=head3 PlotSetFormula()
$plot->PlotSetFormula($ds_index, $count, $formulaX); # 1D
#or
$plot->PlotSetFormula($ds_index, $count, $formulaX, $formulaY); # 2D
#or
$plot->PlotSetFormula($ds_index, $count, $formulaX, $formulaY, $formulaZ); # 3D
Same as PlotSet1D/2D/3D but data is generated from a formula. If
B<$count> is 0 the current size is used. If 2D data then B<$formulaY>
must be non C<undef>. If 3D data then B<$formulaZ> must be non C<undef>. The
variables of the formulas must be x, y and/or z. Coordinates are
evaluated in the [0,1] interval. There is no difference between lower
or upper case in formulas. I<Linear data only.>
The operators and functions can be:
+ - * / ^ (^=integer power)
< > = & | (logical operators, &=true if a and b both nonzero, |=true if x or y nonzero)
sqrt(a) pow(a,b) log(a,b) ln(a) lg(a) (ln(a)=log(e,a) lg(a)=log(10,a)
abs(a) sign(a) mod(a,b) step(a) int(a) rnd pi
abs(a) sign(a) mod(a,b) step(a) int(a) rnd pi
sin(a) cos(a) tan(a) asin(a) acos(a) atan(a)
sinh(a) cosh(a) tanh(a) asinh(a) acosh(a) atanh(a)
=head3 PlotSetFromFormula()
$plot->PlotSetFromFormula($ds_index, $formula);
#or
$plot->PlotSetFromFormula($ds_index, $formula, $count_x);
#or
$plot->PlotSetFromFormula($ds_index, $formula, $count_x, $count_y);
#or
$plot->PlotSetFromFormula($ds_index, $formula, $count_x, $count_y, $count_z);
Same as L<PlotSetData|/"PlotSetData()"> but data is generated from a formula. If
all B<$count_*> are 0 (or undef) the current size remains, and the existing data is
preserved but overwritten if the formula results that. If any
B<$count_*> is NOT zero then the existing data size is removed. The
variables of the formulas must be x, y and/or z. Coordinates are
evaluated in the [0,1] interval. There is no difference between lower
or upper case in formulas. The operators and functions can be:
+ - * / ^ (^=integer power)
< > = & | (logical operators, &=true if a and b both nonzero, |=true if x or y nonzero)
sqrt(a) pow(a,b) log(a,b) ln(a) lg(a) (ln(a)=log(e,a) lg(a)=log(10,a)
abs(a) sign(a) mod(a,b) step(a) int(a) rnd pi
sin(a) cos(a) tan(a) asin(a) acos(a) atan(a)
sinh(a) cosh(a) tanh(a) asinh(a) acosh(a) atanh(a)
DS_COUNT is set to count_x*count_x*count_y.
I<Can be used for linear, planar or volumetric data, but linear data is
limited to 1D coordinates. You can convert planar data into linear data
using the DS_REARRANGE and DS_SPLIT attributes.>
=head3 PlotSetData()
$plot->PlotSetData($ds_index, $data);
Sets an array of samples in the dataset B<$ds_index>. All previous values are removed.
XXX-FIXME-NOT-IMPLEMENTED
=head3 PlotLoadData()
$plot->PlotLoadData($ds_index, $filename);
#or
$plot->PlotLoadData($ds_index, $filename, $count_x);
#or
$plot->PlotLoadData($ds_index, $filename, $count_x, $count_y);
#or
$plot->PlotLoadData($ds_index, $filename, $count_x, $count_y, $count_z);
Same as L<PlotSetData|/"PlotSetData()"> but loads the data from a file. The file
must contains space (' ') separated numeric data in text format. The
text can contains line comments starting with '#'.
DS_COUNT is set to C<$count_x*$count_x*$count_y>. Existing data is removed.
Linear data is limited to 1D coordinates.
If any B<$count_*> is 0 (or undef) all their values are automatically calculated.
The number of elements in the first line defines B<$count_x>, the number
of lines before an empty line or before a form feed ('\f') defines
B<$count_y>, and the number of empty lines or the number of form feeds
('\f') defines B<$count_z>.
I<Can be used for linear, planar or volumetric data, but linear data is
limited to 1D coordinates.> I<You can convert planar data into linear
data using the DS_REARRANGE and DS_SPLIT attributes.>
=head3 PlotDrawMark()
$plot->PlotDrawMark($x, $y, $z);
Draws a mark at given position in plot coordinates. It can be used only
inside PREDRAW_CB and POSTDRAW_CB callbacks. The attributes DRAWCOLOR,
DRAWMARKSTYLE and DRAWMARKSIZE can be used to control mark appearance.
=head3 PlotDrawLine()
$plot->PlotDrawLine($x1, $y1, $z1, $x2, $y2, $z2);
( run in 0.678 second using v1.01-cache-2.11-cpan-f56aa216473 )