Ask Your Question
1

Disabling y-axes in 2-D plot

asked 12 years ago

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

Preview: (hide)

Comments

1

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

ppurka gravatar imageppurka ( 12 years ago )

2 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

achrzesz gravatar image

updated 12 years ago

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()
Preview: (hide)
link
0

answered 12 years ago

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.

Preview: (hide)
link

Comments

Try the edited version above

achrzesz gravatar imageachrzesz ( 12 years ago )

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 ( 12 years ago )

O.K. I did.

achrzesz gravatar imageachrzesz ( 12 years ago )

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: 12 years ago

Seen: 3,770 times

Last updated: Feb 14 '13