# 2d plot axes labels

Hello,

How do I add labels (names) to my axes when doing a simple 2d plot such as:

t = var('t')
E(t)=(10.40*(1-exp(-0.25*t)))^2.81
plot(E,t,(x,0,15))


I would like to do so the labels are aligned directly under the x axis and vertically over the y axis. Is there a way?

edit retag close merge delete

Sort by » oldest newest most voted

Or this may be what you want:

t = var('t')
E(t)=(10.40*(1-exp(-0.25*t)))^2.81
plot(E,t,(x,0,15),frame=True,axes_labels=['$t$ axis','$E$ axis'],axes=False)

more

This is quite close to what I was expecting. Thank you!

( 2012-08-14 20:29:10 -0600 )edit

The following positions the labels at the ends of the axes.

plot(E,t,(x,0,15),axes_labels=['$t$ axis','$E$ axis'])


You could use the text command to position a label.

t = var('t')
E(t)=(10.40*(1-exp(-0.25*t)))^2.81
p=plot(E,t,(x,0,15),axes_labels=['','$E$ axis'])
p+=text('$t$ axis',(8,-30),color='black')
show(p)


You may also be able to use matplotlib to get what you want.

more

Thank you very much!

( 2012-08-14 20:28:00 -0600 )edit