Ask Your Question
1

Disabling y-axes in 2-D plot

asked 2013-02-13 10:55:04 +0100

pinwheel gravatar image

Hi all,

is it possible to switch of the y-axes seperately in a 2-D plot? The intuitive way

plot(exp,axes=[True,False])

is the very same as

plot(exp,axes=True)

Greetings, Markus

edit retag flag offensive close merge delete

Comments

1

I have put up a patch in [#14112](http://trac.sagemath.org/14112).

ppurka gravatar imageppurka ( 2013-02-13 21:20:49 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-02-13 12:18:39 +0100

achrzesz gravatar image

updated 2013-02-14 00:26:06 +0100

In matplotlib you can use for example the link

http://www.shocksolution.com/2011/08/...

In Sage you can use a workaround:

p=plot(sin,ticks=[0.2,[]],thickness=3,zorder=20) 
p+=arrow((-1,0),(1,0),ticks=[0.2,[]],color='black',zorder=10)
p.axes_color('white')  
p.show()
edit flag offensive delete link more
0

answered 2013-02-13 14:53:25 +0100

pinwheel gravatar image

The problem seems to be that I already have a very complicated plot, so I cannot apply matplotlib methods to that (at least I wouldnt know how).

The workaround you mentioned would be enough for me, but actually it doesnt work, because the white x-axes partly lies over the horizontal arrow and the y-axes lies over parts of the plot :/

I really thought that disabling axis seperately is a standard feature. Maybe I switch back to another CAS for this special plot :(

Thanks anyway for your answer.

edit flag offensive delete link more

Comments

Try the edited version above

achrzesz gravatar imageachrzesz ( 2013-02-13 15:48:47 +0100 )edit

Change the zorder of your plot. Look at the difference between plot(0) plot(0, zorder=20) The second one draws the plot above the axes.

ppurka gravatar imageppurka ( 2013-02-13 19:05:11 +0100 )edit

O.K. I did.

achrzesz gravatar imageachrzesz ( 2013-02-14 00:17:18 +0100 )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: 2013-02-13 10:55:04 +0100

Seen: 3,598 times

Last updated: Feb 14 '13