Ask Your Question
2

2d plot axes labels

asked 2012-08-14 08:20:31 -0600

brenogil gravatar image

updated 2015-01-14 03:47:54 -0600

FrédéricC gravatar image

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 flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
2

answered 2012-08-14 19:49:44 -0600

Jason Grout gravatar image

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)
edit flag offensive delete link more

Comments

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

brenogil gravatar imagebrenogil ( 2012-08-14 20:29:10 -0600 )edit
1

answered 2012-08-14 13:57:38 -0600

calc314 gravatar image

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.

edit flag offensive delete link more

Comments

Thank you very much!

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

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: 2012-08-14 08:20:31 -0600

Seen: 6,105 times

Last updated: Aug 14 '12