- edgecolor, facecolor type: str
- edgecolor initial value: black; facecolor initial color: blue (These colors are used when these arguments
are omitted.)
• head_width argument: Specifies the arrowhead width.
• head_length argument: Specifies the arrowhead length.
- head_width, head_length type: int or float
- head_width initial value: 0.003; head_length initial value: head_width × 1.5
- If a negative value is specified for head_width or head_length, the absolute value of the value is applied.
Example:
To draw an arrow with coordinates (0, 0) as its start point and coordinates (0.5, 0.5) as its end
point. Specify blue for the arrow edge color, red for the arrowhead face color, and 0.5 for the head
width and length.
from matplotlib.pyplot import *
arrow(0,0,0.5,0.5,edgecolor="blue",facecolor="red",head_width=0.5,head_length=0.5)
show()
Operation results are shown below.
Note
• When specifying the edgecolor, facecolor, head_width, and head_length arguments, you should
always write a string that specifies an argument (edgecolor= part) as shown in the Example above.
The text string specifying each argument can be entered using C > [matplotlib.pyplot].
• See
"Color Keywords" (page 129)
• The axis is not adjusted automatically if you execute arrow without specifying anything for axis. If
the arrow extends beyond the drawing screen, specify the axis manually.
text(,,)
Draws a text string at the specified coordinates.
Syntax: text( x , y ,text)
• x , y arguments: Specify the coordinates ( x , y ) of the left end of the string.
- x , y type: int or float
• text argument: Specifies a text string.
- There are no restrictions on the text argument's type. Any text string can be entered by enclosing it within
double quotes (" ").
facecolor
head_width
for keywords like blue, red, etc. that can be used to specify colors.
128
edgecolor
head_length
Need help?
Do you have a question about the CLASSWIZ CG and is the answer not in the manual?
Questions and answers