First time here? Check out the FAQ!

Ask Your Question
1

How to add arrow tips to axes

asked 0 years ago

Graph Karl gravatar image

I would like to have the axes displayed with arrow tips at the end. I have seen this question asked before but since that was some time ago I wondered if there is a simple way to do it now that doesn't involve plotting them manually. I appreciate the help.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 0 years ago

vdelecroix gravatar image

This is a good question! I only know of a workaround by using matplotlib

import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import AxesZero

fig = plt.figure()
ax = fig.add_subplot(axes_class=AxesZero)
for direction in ["xzero", "yzero"]:
    ax.axis[direction].set_axisline_style('-|>')
    ax.axis[direction].set_visible(True)
for direction in ["left", "right", "bottom", "top"]:
    ax.axis[direction].set_visible(False)

P = plot(x**2, (x, 0, 1))
P.axes(False)
P_plt = P.matplotlib(figure=fig)
plt.show()

See https://matplotlib.org/stable/gallery... and https://ask.sagemath.org/question/762...

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 0 years ago

Seen: 363 times

Last updated: Jul 03 '24