how to change show() defaults for 2D plots

3 views
Skip to first unread message

Johannes Huisman

unread,
Jul 10, 2010, 1:38:56 PM7/10/10
to sage-s...@googlegroups.com
Is there a way to change default settings of the show()
method for 2D plots? According to the reference manual,
such a feature exists for 3D plots through the commands

from sage.plot.plot3d.base import SHOW_DEFAULTS
SHOW_DEFAULTS['frame']=False

They set the default value of frame to False
for the 3D show() method. Indeed,

var('t,u,v')
cubic=t*(u^2+v^2+1)-u*v
S=implicit_plot3d(cubic==0,(t,-3,3),(u,-3,3),(v,-3,3))
S.show()

then results in a nice cubic surface being displayed
without frames; no need to type

S.show(frame=False)

However, for 2D plots, this feature does not seem to
be available, or did I miss something?

Johan

--
http://pageperso.univ-brest.fr/~huisman

Johannes

unread,
Jul 11, 2010, 8:21:29 AM7/11/10
to sage-support
Is there a way to change default settings of the show()
method for 2D plots? According to the reference manual,
such a feature does exist for 3D plots through the commands

from sage.plot.plot3d.base import SHOW_DEFAULTS
SHOW_DEFAULTS['frame']=False

They set the default value of frame to False
for the 3D show() method. Indeed, the commands

var('t,u,v')
cubic=t*(u^2+v^2+1)-u*v
S=implicit_plot3d(cubic==0,(t,-3,3),(u,-3,3),(v,-3,3))
S.show()

then result in a nice cubic surface being displayed

Johannes

unread,
Jul 11, 2010, 8:48:51 AM7/11/10
to sage-support
Sorry for posting twice. I just noticed that
my first message got through all right, though I did
not receive it myself! Is this a common behaviour
of google groups?

Johan

Mike Hansen

unread,
Jul 11, 2010, 2:17:49 PM7/11/10
to sage-s...@googlegroups.com
On Sun, Jul 11, 2010 at 5:48 AM, Johannes <johannes...@gmail.com> wrote:
> Sorry for posting twice. I just noticed that
> my first message got through all right, though I did
> not receive it myself! Is this a common behaviour
> of google groups?

Yes, this is a common behavior of Google Groups and Gmail.

You can set defaults in the plot.options dictionary.

sage: plot.options['frame'] = False

--Mike

Johannes Huisman

unread,
Jul 12, 2010, 2:57:45 AM7/12/10
to sage-s...@googlegroups.com

Thanks, but I did try that. It doesn't make
any difference, in any case in sage version 4.4.3
that I'm running. In fact, the sage dictionary
plot.options does not contain the keyword 'frame'.
So, setting it to False is, of course possible,
but seemingly without any effect.

Johan

--
http://pageperso.univ-brest.fr/~huisman

William Stein

unread,
Jul 12, 2010, 3:38:30 AM7/12/10
to sage-s...@googlegroups.com
On Mon, Jul 12, 2010 at 8:57 AM, Johannes Huisman
<johannes...@gmail.com> wrote:
> Mike Hansen wrote:
>>
>> On Sun, Jul 11, 2010 at 5:48 AM, Johannes <johannes...@gmail.com>
>> wrote:
>>>
>>> Sorry for posting twice. I just noticed that
>>> my first message got through all right, though I did
>>> not receive it myself! Is this a common behaviour
>>> of google groups?
>>
>> Yes, this is a common behavior of Google Groups and Gmail.
>>
>> You can set defaults in the plot.options dictionary.
>>
>> sage: plot.options['frame'] = False
>
> Thanks, but I did try that. It doesn't make
> any difference, in any case in sage version 4.4.3

The above changes the options for the plot command.
The poster is asking about changing the default options for
the show command. I don't think Sage supports this yet.

We implemented 3d plotting after 2d plotting, hence 3d plotting got some
features that 2d plotting obviously should have...

William

> that I'm running. In fact, the sage dictionary
> plot.options does not contain the keyword 'frame'.
> So, setting it to False is, of course possible,
> but seemingly without any effect.
>
> Johan
>
> --
> http://pageperso.univ-brest.fr/~huisman
>

> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages