PSTricks

PSTricks

Geometric Primitives

Lines and Paths

Line

\psline(x0,y0)(x1,y1)

Line with arrow

\psline{->}(x1,y1)(x2,y2)

Polyline (multiple connected segments)

\psline(x0,y0)(x1,y1)...(xn,yn)

Polygon

Draws a polygon by connecting a sequence of points with straight lines and automatically closing the shape by connecting the last point back to the first.

\pspolygon(x0,y0)(x1,y1)...(xn,yn)

Smooth Curve

\pscurve(x1,y1)(x2,y2)...

Bézier Curve

\psbezier(x1,y1)(x2,y2)(x3,y3)(x4,y4)

Rectangle

\psframe(x0,y0)(x1,y1)

Circles and Ellipses

Circle

\pscircle(center)(radius)

Ellipse

\psellipse(xdim, ydim)

Elliptical Arc

\psellipticarc(...)

Arcs

Arc (clockwise)

\psarc(center)(radius){startAngle}{endAngle}

Arc (counterclockwise)

\psarcn(center)(radius){startAngle}{endAngle}

Points and Dots

Single Dot

\psdot(x,y)

Multiple Dots

\psdots(x0,y0)(x1,y1)...

Boxes

Box around text

\psframebox{Text}
Filled box
\psframebox*[options]{Text}

Circle around text

\pscirclebox{Text}

Oval around text

\psovalbox{Text}

Other Shapes

Diamond Shape

\psdiamond(width,height)

Common Options (usable with most commands)

  • fillcolor=...
  • fillstyle=solid|none|crosshatch|...
  • linecolor=...
  • linestyle=solid|dashed|dotted|...
  • linewidth=...