📄 xgrafix.tex
字号:
$XGCurveVector$($x\_array$, $y\_array$, $npoints$, $color$, $x\_size$,$x\_offset$, $y\_size$, $y\_offset$) \\SCALAR *$x\_array$; /* x array to be plotted */ \\SCALAR *$y\_array$; /* y array to be plotted */ \\int *$npoints$; /* number of points in the x (and y) direction */ \\int $color$; /* plot color chosen from 0-9 */ \\int $x\_size$; /* number of SCALARs in the stucture whichcontains the x data */ \\int $x\_offset$; /* number of SCALARs preceding the x fieldin the structure containing the x data */ \\int $y\_size$; /* number of SCALARs in the structure which contains the y data*/ \\int $y\_offset$; /* number of SCALARs preceding the y field in the structure containing the y data*/\end{flushleft}\begin{flushleft}$XGScat2D$($x\_array$, $y\_array$, $npoints$, $color$) \\SCALAR *$x\_array$; /* x array to be plotted */ \\SCALAR *$y\_array$; /* y array to be plotted */ \\int *$npoints$; /* number of points in the x (and y) direction */ \\int $color$; /* plot's color chosen from 0-9 */\end{flushleft}These functions add a curve to an existing plotting frame. Each callto $XGCurve$(), $XGCurveVector$ () or $XGScat2D$() associates the curve or scatter plotwith the plot frame corresponding to the preceding call to $XGSet2D$().Note that each frame can contain one or more curves or scatter plots, inany combination.{\bf Note} that the $x\_array$, $y\_array$, and $npoints$ are shared memory.Therefore, once the pointers have been passed, these memory must not be freedor moved until program termination. {\bf Also note} that ``SCALAR'' is set to either ``float'' or``double'' during the compilation of XGrafix. It is defined in thefiles xgrafix.h and xgdatamacros.h.\def\xlen{4in}\begin{minipage}{\xlen}\begin{flushright}\rule{\xlen}{.5pt}\end{flushright}\end{minipage}\begin{flushleft}$XGSetVec$($PlotType$, $X\_Label$, $Y\_Label$, $State: Exp $, $ulx$, $uly$, $X\_Scale$, $Y\_Scale$, \\\hspace{.8in} $X\_Auto\_Rescale$, $Y\_Auto\_Rescale$, $X\_Min$, $X\_Max$, $Y\_Min$, $Y\_Max$) \\char *$PlotType$; /* only ``vecvec'' is permitted*/ \\char *$X\_Label$; /* x label for the frame */ \\char *$Y\_Label$; /* y label for the frame*/ \\char *$Z\_Label$; /* z label for the frame (name of vectors) */ \\char *$State: Exp $; /* ``open'' or ``closed'' */ \\int $ulx$, $uly$; /* requested position of frame's upper left corner */ \\SCALAR $X\_Scale$; /* scaling factor for the x array */ \\SCALAR $Y\_Scale$; /* scaling factor for the y array */ \\int $X\_Auto\_Rescale$; /* if True $X\_Min$ and $X\_Max$ are ignored */ \\int $Y\_Auto\_Rescale$; /* if True $Y\_Min$ and $Y\_Max$ are ignored */ \\SCALAR $X\_Min$, $X\_Max$; /* x bounds for the plot if $X\_Auto\_Rescale$ is False */ \\SCALAR $Y\_Min$, $Y\_Max$; /* y bounds for the plot if $Y\_Auto\_Rescale$ is False */ \end{flushleft}This functions sets up a vector plot, and is otherwise similar to$XGSet2D$(). The additional parameter $Z\_Label$ is described above.Note that $PlotType$ must be set to ``vecvec''.A call to $XGSetVec$() must be followed by one and only one call to either$XGVector$() or $XGVectorVector$().\begin{flushleft}$XGVector$($x\_array$, $y\_array$, $x\_component\_data$,$y\_component\_data$, $mpoints$, $npoints$, $color$) \\SCALAR *$x\_array$; /* x position array to be plotted */ \\SCALAR *$y\_array$; /* y positionarray to be plotted*/ \\SCALAR **$x\_component\_data$; /* x component of vectors */ \\SCALAR **$y\_component\_data$; /* y component of vectors */ \\int *$mpoints$; /* number of points in the x direction */ \\int *$npoints$; /* number of points in the y direction */ \\int $color$; /* plot color chosen from 0-9 */\end{flushleft}\begin{flushleft}$XGVectorVector$($x\_array$, $y\_array$, $x\_component\_data$,$y\_component\_data$, $mpoints$, $npoints$, $color$, $x\_size$,$x\_offset$, $y\_size$, $y\_offset$, $x\_component\_size$,$x\_component\_offset$, $y\_component\_size$, $y\_component\_offset$ ) \\SCALAR *$x\_array$; /* x position array to be plotted */ \\SCALAR *$y\_array$; /* y position array to be plotted*/ \\SCALAR **$x\_component\_data$; /* x component of vectors */ \\SCALAR **$y\_component\_data$; /* y component of vectors */ \\int *$mpoints$; /* number of points in the x direction */ \\int *$npoints$; /* number of points in the y direction */ \\int $color$; /* plot color chosen from 0-9*/ \\int $x\_size$; /* number of SCALARs in the stucture whichcontains the x position data */ \\int $x\_offset$; /* number of SCALARs preceding the x fieldin the structure containing the x position data */ \\int $y\_size$; /* number of SCALARs in the structure whichcontains the y position data*/ \\int $y\_offset$; /* number of SCALARs preceding the y field in the structure containing the y position data*/ \\int $x\_component\_size$; /* number of SCALARs in the stucture whichcontains the x component data */ \\int $x\_component\_offset$; /* number of SCALARs preceding the xcomponent field in the structure containing the x component data */ \\int $y\_component\_size$; /* number of SCALARs in the structure whichcontains the y component data */ \\int $y\_component\_offset$; /* number of SCALARs preceding the ycomponent field in the structure containing the y component data */\end{flushleft}As in the case of $XGCurve$ (), $XGCurveVector$ () and $XGScat2D$ ()these functions acquire data via shared memory. Once the pointershave been sent, the memory arrays must not be moved or freed untilprogram termination. Note, however, that only one plot per frame isallowed for three-axis plots.\def\xlen{4in}\begin{minipage}{\xlen}\begin{flushright}\rule{\xlen}{.5pt}\end{flushright}\end{minipage}\begin{flushleft}$XGSet3D$($PlotType$, $X\_Label$, $Y\_Label$, $Z\_Label$, $Theta$, $Phi$, $State: Exp $, $ulx$, $uly$, \\\hspace{.8in} $X\_Scale$, $Y\_Scale$, $Z\_Scale$, $X\_Auto\_Rescale$, $Y\_Auto\_Rescale$, \\\hspace{.8in} $Z\_Auto\_Rescale$, $X\_Min$, $X\_Max$, $Y\_Min$, $Y\_Max$, $Z\_Min$, $Z\_Max$) \\char *$PlotType$; /* ``linlinlin'', ``linlinlog'', ``linloglog'', etc. */ \\char *$X\_Label$; /* x label for the frame */ \\char *$Y\_Label$; /* y label for the frame */ \\char *$Z\_Label$; /* z label for the frame */ \\SCALAR $Theta$, $Phi$; /* initial viewing angles */ \\char *$State: Exp $; /* ``open'' or ``closed'' */ \\int $ulx$, $uly$; /* requested position of frame's upper left corner */ \\SCALAR $X\_Scale$; /* scaling factor for the x array */ \\SCALAR $Y\_Scale$; /* scaling factor for the y array */ \\SCALAR $Z\_Scale$; /* scaling factor for the z array */ \\int $X\_Auto\_Rescale$; /* if True $X\_Min$ and $X\_Max$ are ingonred */ \\int $Y\_Auto\_Rescale$; /* if True $Y\_Min$ and $Y\_Max$ are ignored */ \\int $Z\_Auto\_Rescale$; /* if True $Z\_Min$ and $Z\_Max$ are ignored */ \\SCALAR $X\_Min$, $X\_Max$; /* x bounds for the plot if $X\_Auto\_Rescale$ is False */ \\SCALAR $Y\_Min$, $Y\_Max$; /* y bounds for the plot if $Y\_Auto\_Rescale$ is False */ \\SCALAR $Z\_Min$, $Z\_Max$; /* z bounds for the plot if $Z\_Auto\_Rescale$ is False */\end{flushleft}This functions sets up a three-axis plot frame, and is otherwise similar to$XGSet2D$(). Additional parameters described above for the thirddimension include $Z\_Label$, $Z\_Scale$, $Z\_Auto\_Rescale$, $Z\_Min$ and $Z\_Max$.The other additional parameters specify the viewing direction for the plotframe. $Theta$ specifies the polar angle (0-180 degrees). $Phi$ specifiesthe azimuthal angle (0-360 degrees). There is no perspective available inthis type of plot.A call to $XGSet3D$() must be followed by one and only one call toeither $XGSurf$ (), $XGSurfVector$ () or $XGScat3D$ (). \begin{flushleft}$XGScat3D$($x\_array$, $y\_array$, $z\_array$, $npoints$, $color$) \\SCALAR *$x\_array$; /* x array to be plotted */ \\SCALAR *$y\_array$; /* y array to be plotted */ \\SCALAR *$z\_array$; /* z array to be plotted */ \\int *$npoints$; /* number of points in the x, y and z direction */ \\int $color$; /* plot's color chosen from 0-9 */\end{flushleft}\begin{flushleft}$XGSurf$($x\_array$, $y\_array$, $z\_array$, $mpoints$, $npoints$, $color$) \\SCALAR *$x\_array$; /* x array to be plotted */ \\SCALAR *$y\_array$; /* y array to be plotted */ \\SCALAR **$z\_array$; /* z array to be plotted */ \\int *$mpoints$; /* number of points in the x direction */ \\int *$npoints$; /* number of points in the y direction */ \\int $color$; /* plot's color chosen from 0-9 */\end{flushleft}\begin{flushleft}$XGSurfVector$($x\_array$, $y\_array$, $z\_array$, $mpoints$,$npoints$, $color$, $x\_size$, $x\_offset$, $y\_size$, $y\_offset$, $z\_size$, $z\_offset$) \\SCALAR *$x\_array$; /* x array to be plotted */ \\SCALAR *$y\_array$; /* y array to be plotted */ \\SCALAR **$z\_array$; /* z array to be plotted */ \\int *$mpoints$; /* number of points in the x direction */ \\int *$npoints$; /* number of points in the y direction */ \\int $color$; /* plot's color chosen from 0-9*/ \\int $x\_size$; /* number of SCALARs in the stucture whichcontains the x data */ \\int $x\_offset$; /* number of SCALARs preceding the x fieldin the structure containing the x data */ \\int $y\_size$; /* number of SCALARs in the structure which contains the y data*/ \\int $y\_offset$; /* number of SCALARs preceding the y field in the structure containing the y data*/ \\int $z\_size$; /* number of SCALARs in the structure which contains the z data*/ \\int $z\_offset$; /* number of SCALARs preceding the z field in the structure containing the z data*/\end{flushleft}$XGScat3D$() adds a three-axis scatter plot to the plot frame set up by thepreceding call to $XGSet3D$(). $XGSurf$() and $XGSurfVector$() add athree-axis wireframe/surface plot to the plot frame set up by the preceding call to $XGSet3D$().As in the case of $XGScat2D$(), $XGCurve$() and $XGCurveVector$(), these functions acquire datavia shared memory. Once the pointers have been sent, the memory arrays mustnot be moved or freed until program termination. Note, however, that onlyone plot per frame is allowed for three-axis plots.\newpage\def\xlen{4in}\begin{minipage}{\xlen}\begin{flushright}\rule{\xlen}{.5pt}\end{flushright}\end{minipage}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -