Ask Your Question
4

2d plot axes labels

asked 2012-08-14 15:20:31 +0200

brenogil gravatar image

updated 2015-01-14 10:47:54 +0200

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
4

answered 2012-08-15 02:49:44 +0200

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-15 03:29:10 +0200 )edit
1

answered 2012-08-14 20:57:38 +0200

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-15 03:28:00 +0200 )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 15:20:31 +0200

Seen: 18,177 times

Last updated: Aug 15 '12