Ask Your Question
1

Disabling y-axes in 2-D plot

asked 2013-02-13 03:55:04 -0500

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 14:20:49 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-02-13 05:18:39 -0500

achrzesz gravatar image

updated 2013-02-13 17:26:06 -0500

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 07:53:25 -0500

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 08:48:47 -0500 )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 12:05:11 -0500 )edit

O.K. I did.

achrzesz gravatar imageachrzesz ( 2013-02-13 17:17:18 -0500 )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 03:55:04 -0500

Seen: 1,045 times

Last updated: Feb 13 '13