Partial arcs of circles may be drawn using the arc command. This has similar syntax to the circle command, but takes two additional angles, measured clockwise from the upward vertical direction, which specify the extent of the arc to be drawn. The arc is drawn clockwise from start to end, and hence the following two instructions draw two complementary arcs which together form a complete circle:
set multiplot arc at 0,0 radius 5 from -90 to 0 with lw 3 col red arc at 0,0 radius 5 from 0 to -90 with lw 3 col green
If a fillcolour is specified, then a pie-wedge is drawn:
arc at 0,0 radius 5 from 0 to 30 with lw 3 fillcolour red
A labelled diagram of a triangle.
In this example, we make a subroutine to draw labelled diagrams of the interior angles of triangles, taking as its inputs the lengths of the three sides of the triangle to be drawn and the position of its lower-left corner. The subroutine calculates the positions of the three vertices of the triangle and then labels them. We use PyXPlot’s automatic handling of physical units to generate the LaTeX strings required to label the side lengths in centimetres and the angles in degrees. We use PyXPlot’s arc command to draw angle symbols in the three corners of a triangle. |
# Define subroutine for drawing triangles |
# Positions of three corners of triangle |
# Draw triangle |
# Draw angle symbols |
# Label lengths of sides |
# Label angles |
# Label points ABC |
# Display diagram with three triangles |
The resulting diagram is shown below: |
![]() |
A labelled diagram of a converging lens forming a real image.
In this example, we make a subroutine to draw labelled diagrams of converging lenses forming real images. |
subroutine LensDraw(x0,y0,u,h,f) |
# Draw lens |
# Draw object and image |
# Draw construction lines |
# Label distances u and v |
# Display diagram of lens |
The resulting diagram is shown below: |
![]() |