Arrows may also be added to multiplot canvases using the arrow command, which has syntax:
arrow from x,y to x,y
The arrow command may be followed by the with keyword to specify to style of the arrow. The line type, line width and colour of the arrow, may be specified using the same syntax as used in the plot command, using the linetype, linewidth and colour modifiers after the word with, as in the example:
arrow from 0,0 to 10,10 \ with linetype 2 linewidth 5 colour red
The style of the arrow may also be specified after the word with, and three options are available: head (the default), nohead, which produces line segments with no arrowheads on them, and twoway, which produces bidirectional arrows with heads on both ends.
The arrow command has a twin, the line command, which has the same syntax but with a different style setting of nohead.
A simple notice generated with the text and arrow commands.
In this example script, we use PyXPlot’s arrow and text commands to produce a simple notice advertising that a lecture has moved to a different seminar room: |
# Turn on multiplot mode |
# Set the dimensions of the notice |
# Put a rectangular box around the notice |
# Write the text of the notice in big letters |
# Display the notice |
The resulting notice is shown below: |
![]() |
A diagram from Euclid’s Elements.
In this more extended example script, we use PyXPlot’s arrow and text commands to reproduce a diagram illustrating the 47th Proposition from Euclid’s First Book of Elements, better known as Pythagoras’ Theorem. A full text of the proof which accompanies this diagram can be found at http://www.gutenberg.org/etext/21076. |
set multiplot ; set nodisplay |
# Lengths of three sides of triangle |
# Positions of three corners of triangle |
# Positions of constructed points |
Hx = Bx + (AB + AC) * cos(CBA) |
Fx = Bx + AB*cos(CBA+90*unit(deg)) |
# Construct diagram |
# Label diagram |
# Display diagram |
The resulting diagram is shown below: |
![]() |
A diagram of the conductivity of nanotubes.
In this example we produce a diagram of the irreducible wedge of possible carbon nanotube configurations, highlighting those configurations which are electrically conductive. We use PyXPlot’s loop constructs to automate the production of the hexagonal grid which forms the basis of the diagram. |
BASIS_ANGLE_X = (0 )*unit(deg) |
subroutine line(x1,y1,x2,y2,lw) |
subroutine hexagon(x,y,lw) |
set multiplot |
for XPOS=0 to 10 |
set display |
![]() |