Sage: Ticket #14112: Allow to turn off axes selectively in plot
https://trac.sagemath.org/ticket/14112
<p>
There have been a couple of questions regarding more control over the axes in plot. <a class="ext-link" href="http://ask.sagemath.org/question/2251/disabling-y-axes-in-2-d-plot"><span class="icon"></span>One question</a> asks to be able to selectively turn off y-axis. Some option like this, which extends the <code>axes</code> keyword should do the job quite nicely.
</p>
<pre class="wiki">plot(x, axes=[True, False])
</pre><hr />
<p>
Apply to devel/sage: <a class="attachment" href="https://trac.sagemath.org/attachment/ticket/14112/trac_14112-allow_individual_axes.patch" title="Attachment 'trac_14112-allow_individual_axes.patch' in Ticket #14112">trac_14112-allow_individual_axes.patch</a><a class="trac-rawlink" href="https://trac.sagemath.org/raw-attachment/ticket/14112/trac_14112-allow_individual_axes.patch" title="Download"></a>
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/14112
Trac 1.1.6ppurkaThu, 14 Feb 2013 02:18:37 GMTattachment set
https://trac.sagemath.org/ticket/14112
https://trac.sagemath.org/ticket/14112
<ul>
<li><strong>attachment</strong>
set to <em>trac_14112-allow_individual_axes.patch</em>
</li>
</ul>
<p>
Apply to devel/sage
</p>
TicketppurkaThu, 14 Feb 2013 02:19:51 GMTstatus, description changed; author set
https://trac.sagemath.org/ticket/14112#comment:1
https://trac.sagemath.org/ticket/14112#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>description</strong>
modified (<a href="/ticket/14112?action=diff&version=1">diff</a>)
</li>
<li><strong>author</strong>
set to <em>Punarbasu Purkayastha</em>
</li>
</ul>
<p>
Added a patch to introduce the needed functionality. Needs review. :)
</p>
TicketkcrismanThu, 14 Feb 2013 02:59:23 GMTcc set
https://trac.sagemath.org/ticket/14112#comment:2
https://trac.sagemath.org/ticket/14112#comment:2
<ul>
<li><strong>cc</strong>
<em>kcrisman</em> added
</li>
</ul>
TicketkcrismanFri, 14 Jun 2013 16:44:31 GMTstatus changed; reviewer set
https://trac.sagemath.org/ticket/14112#comment:3
https://trac.sagemath.org/ticket/14112#comment:3
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>needs_work</em>
</li>
<li><strong>reviewer</strong>
set to <em>Karl-Dieter Crisman</em>
</li>
</ul>
<p>
What do you think that extra
</p>
<pre class="wiki">if axes is None
</pre><p>
was there for? It seems okay to remove it.
</p>
<p>
What do you think would happen with
</p>
<pre class="wiki">yaxis='right'
</pre><p>
instead of <code>'left'</code> at the end? I'm just curious if it would make a difference. I suppose I could try it out... it doesn't <em>seem</em> to make a difference. Does it need to be set at all? Answering my own question... hmm, I think we need to decide what to do here.
</p>
<pre class="wiki">sage: plot(x,(x,-10,-8),axes=[False,True],axes_labels=['x','y'])
sage: plot(x,(x,8,10),axes=[False,True],axes_labels=['x','y'])
</pre><p>
Should this be valid? And currently the <code>x</code>-axis in the first one shows up at the bottom, which is wrong (in some sense). Probably it should just be turned off. Putting needs work, but maybe it's closer to needs info. Otherwise I like this.
</p>
TicketppurkaFri, 14 Jun 2013 18:11:47 GMT
https://trac.sagemath.org/ticket/14112#comment:4
https://trac.sagemath.org/ticket/14112#comment:4
<p>
The <code>axes is none</code> was just setting the default if the user did not specify axes.
</p>
<p>
I don't understand why this is working when the <code>if</code> statement is removed; in fact I don't remember much about this patch. Will need some time to revisit this.
</p>
TicketppurkaFri, 14 Jun 2013 18:16:01 GMT
https://trac.sagemath.org/ticket/14112#comment:5
https://trac.sagemath.org/ticket/14112#comment:5
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/14112#comment:3" title="Comment 3">kcrisman</a>:
</p>
<blockquote class="citation">
<pre class="wiki">sage: plot(x,(x,-10,-8),axes=[False,True],axes_labels=['x','y'])
sage: plot(x,(x,8,10),axes=[False,True],axes_labels=['x','y'])
</pre><p>
Should this be valid? And currently the <code>x</code>-axis in the first one shows up at the bottom, which is wrong (in some sense). Probably it should just be turned off. Putting needs work, but maybe it's closer to needs info. Otherwise I like this.
</p>
</blockquote>
<p>
I get the x-axis turned off in both the plots. Is that not what you are getting? The x label is still there and the labels don't seem centered any more.
</p>
TicketkcrismanFri, 14 Jun 2013 18:39:19 GMT
https://trac.sagemath.org/ticket/14112#comment:6
https://trac.sagemath.org/ticket/14112#comment:6
<blockquote class="citation">
<p>
The axes is none was just setting the default if the user did not specify axes.
</p>
</blockquote>
<p>
Yeah, but it was there <em>twice</em>.
</p>
<blockquote class="citation">
<blockquote>
<p>
Is that not what you are getting?
</p>
</blockquote>
</blockquote>
<p>
Sorry, that's what I meant - the <code>x</code> label for the axis.
</p>
TicketppurkaTue, 02 Jul 2013 15:09:20 GMT
https://trac.sagemath.org/ticket/14112#comment:7
https://trac.sagemath.org/ticket/14112#comment:7
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/14112#comment:6" title="Comment 6">kcrisman</a>:
</p>
<blockquote class="citation">
<p>
Sorry, that's what I meant - the <code>x</code> label for the axis.
</p>
</blockquote>
<p>
Sorry, why should the label be removed? Maybe the user actually wants the label. There is always the option of passing <code>axes_labels=['', 'y']</code> if the user does not want the axis to be labeled either.
</p>
TicketkcrismanTue, 02 Jul 2013 15:12:39 GMT
https://trac.sagemath.org/ticket/14112#comment:8
https://trac.sagemath.org/ticket/14112#comment:8
<p>
Well, but <em>where</em> should the labels for the axes be? I suppose you really could have an axis label if you don't have an axis... though it seems weird. It looks like a random floating letter.
</p>
TicketppurkaTue, 02 Jul 2013 15:22:01 GMT
https://trac.sagemath.org/ticket/14112#comment:9
https://trac.sagemath.org/ticket/14112#comment:9
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/14112#comment:8" title="Comment 8">kcrisman</a>:
</p>
<blockquote class="citation">
<p>
Well, but <em>where</em> should the labels for the axes be? I suppose you really could have an axis label if you don't have an axis... though it seems weird. It looks like a random floating letter.
</p>
</blockquote>
<p>
I don't know if the position of the label can be controlled. It is up to mpl to position it. But, this is really up to the user to decide if (s)he wants the label or not. It does look like an isolated letter, partly because it is a single letter in our examples.
</p>
TicketjdemeyerTue, 13 Aug 2013 15:35:53 GMTmilestone changed
https://trac.sagemath.org/ticket/14112#comment:10
https://trac.sagemath.org/ticket/14112#comment:10
<ul>
<li><strong>milestone</strong>
changed from <em>sage-5.11</em> to <em>sage-5.12</em>
</li>
</ul>
Ticketvbraun_spamThu, 30 Jan 2014 21:20:52 GMTmilestone changed
https://trac.sagemath.org/ticket/14112#comment:11
https://trac.sagemath.org/ticket/14112#comment:11
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.1</em> to <em>sage-6.2</em>
</li>
</ul>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/14112#comment:12
https://trac.sagemath.org/ticket/14112#comment:12
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
Ticketvbraun_spamSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/14112#comment:13
https://trac.sagemath.org/ticket/14112#comment:13
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
Ticket