12.07.2015 Views

graphics with PSTric..

graphics with PSTric..

graphics with PSTric..

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Plotting Tricks\begin{pspicture}(-2,-3)(2,3)\psgrid[gridcolor=Apricot,%gridlabelcolor=Mahogany,%subgridcolor=Apricot]\psplot[plotstyle=curve,%linecolor=Blue]%{-1.5}{1.5}{x 3 exp x sub}\end{pspicture}Function plottingAxes of coordinatesData plottingThe first command \psgrid just draws the coordinate grid, as we haveseen earlier. The actual curve is drawn by the \psplot command. Let’slook at this a bit more closely. The expression x 3 exp x sub is just thePostScirpt way of saying x 3 − x. In general, we must specify the equationwhich gives the y-coordinate of each point of the curve in terms of the x-coordinate.(or as mathematicians prefer to say, y should be given as a function of x).The numbers -1.5 and 1.5 give respectively the minimum and maximumvalue of the x-coordinate in the curve to be drawn. Thus the basic drawingcommand is\psplot{min x}{man x}{equation}Looking back at our example, we see that here, the command \psplot alsoincludes some parameters. The setting linecolor=Blue just makes the curveblue. What about plotstyle=curve? This makes \psplot draw a \pscurvethrough a certain number of points <strong>with</strong> coordinates computed from theequation. The number of points used is by default 50, but it can be controlledby the parameter plotpoints. This is illustrated in the next example:Online L A TEX TutorialPart II – Graphics<strong>PSTric</strong>ksE Krishnan, CV Radhakrishnan and AJ Alexconstitute the <strong>graphics</strong> tutorial team. Commentsand suggestions may be mailed totutorialteam@tug.org.inc○2002, 2003, The Indian TEX Users GroupThis document is generated by PDFTEX <strong>with</strong>hyperref, pstricks, pdftricks and pdfscreenpackages in an intel PC running GNU/LINUXand is released under LPPLThe Indian TEX Users GroupFloor III, SJP Buildings, Cotton HillsTrivandrum 695014, INDIAhttp://www.tug.org.in£ ¡ ¢ ¤ ¥ ¦ © 4/31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!