Opened 12 years ago

Closed 3 years ago

#10657 closed defect (fixed)

options for items in a GraphicsArray() should be set independently

Reported by: Niles Johnson Owned by: jason, was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: GraphicsArray, matplotlib
Cc: Karl-Dieter Crisman, Paul Masson, Frédéric Chapoton Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Karl-Dieter Crisman)

In particular, one ought to be able to specify axes=True/False on a per-graphic basis, if desired.

Currently, the following results in 8 plots with axes, and a text frame which also has axes, even though axes=False is explicitly given.

A = [plot(sin(t+k*pi/4),(-pi,pi)) for k in range(8)] + [text('hello world',(0,0), axes=False)]
graphics_array(A,3,3)

See the post at asksage about this issue for more details.

Related tickets:

  • #11160 - Graphics Arrays need suboptions somehow
  • #10656 - Graphics Arrays should be able to become Graphics objects

Attachments (1)

sage0.png (52.9 KB) - added by Eviatar Bach 11 years ago.
Picture of bug

Download all attachments as: .zip

Change History (21)

comment:1 Changed 12 years ago by Niles Johnson

Type: PLEASE CHANGEdefect

comment:2 Changed 12 years ago by Karl-Dieter Crisman

Cc: Karl-Dieter Crisman added

comment:3 Changed 11 years ago by Eviatar Bach

This is also a problem with other options, such as tick_formatter, ticks, and axes_labels. They are only applied to the last graphic; see attached image produced by the following code:

graphics_array([plot(sin(B*x), xmin=-2*pi, xmax=2*pi, tick_formatter=pi, ticks=pi/2, axes_labels=('', '%s'%B)) for B in [-2,-1,-1/2,1/2,1,2]], 3, 2)

Changed 11 years ago by Eviatar Bach

Attachment: sage0.png added

Picture of bug

comment:4 Changed 11 years ago by Karl-Dieter Crisman

Description: modified (diff)

comment:5 in reply to:  3 Changed 11 years ago by Karl-Dieter Crisman

Replying to eviatarbach:

This is also a problem with other options, such as tick_formatter, ticks, and axes_labels. They are only applied to the last graphic; see attached image produced by the following code:

> graphics_array([plot(sin(B*x), xmin=-2*pi, xmax=2*pi, tick_formatter=pi, ticks=pi/2, axes_labels=('', '%s'%B)) for B in [-2,-1,-1/2,1/2,1,2]], 3, 2)

#12591 is this. I'm going to suggest we keep this ticket for the original issue, though clearly they are related.

comment:6 Changed 10 years ago by Punarbasu Purkayastha

Workaround from sage-support:

p = plot(x, axes_labels=['x', 'x'])
q = plot(x^2, axes_labels=['x', 'x^2'])
r = plot(exp, axes_labels=['x', 'exp'])
# We want the order p,q,r; so we start with cyclic shifts 
graphics_array([q, r, p]).show() # cyclic permutation
graphics_array([r, p, q]).show() # cyclic permutation of above
graphics_array([p, q, r]).show() # another shift to get our order.

comment:7 Changed 10 years ago by Karl-Dieter Crisman

Somewhere in this set of related tickets we should also unify the usage of figsize between graphics objects and graphics arrays. Maybe graphics arrays need to be a separate file eventually..

comment:8 Changed 8 years ago by Karl-Dieter Crisman

Here is another report, by a seasoned Sage user.

comment:9 Changed 8 years ago by Karl-Dieter Crisman

This should include setting axes for each plot; currently you can just set them all at once...

comment:10 Changed 8 years ago by Karl-Dieter Crisman

Okay, the problem seems to be that we use the matplotlib save command for each (sub)figure, which doesn't seem to set them, but then the Sage save command for the very last one - which gives it the options as well as puts the image in the right file to appear. At #12591 there is some work at fixing a related issue that is basically the same bug, but fixing them together will be a little tricky, though a good thing in the long run.

comment:11 Changed 8 years ago by Karl-Dieter Crisman

This post is probably also the same thing.

comment:12 Changed 6 years ago by Paul Masson

Cc: Paul Masson added

comment:13 Changed 6 years ago by Karl-Dieter Crisman

Here is yet another example.

comment:14 Changed 5 years ago by Karl-Dieter Crisman

This example is probably the same thing.

See also #10466, which I think is probably the same thing too.

comment:15 Changed 5 years ago by Karl-Dieter Crisman

comment:16 Changed 4 years ago by Eric Gourgoulhon

The issues described here are fixed in #27865.

comment:17 Changed 3 years ago by Eric Gourgoulhon

Milestone: sage-duplicate/invalid/wontfix
Status: newneeds_review

Since #27865 has been merged in Sage 8.9.beta0, we could close this ticket as duplicate.

comment:18 Changed 3 years ago by Eric Gourgoulhon

Cc: fchapoton added

comment:19 Changed 3 years ago by Eric Gourgoulhon

Cc: Frédéric Chapoton added; fchapoton removed

comment:20 Changed 3 years ago by Frédéric Chapoton

Resolution: fixed
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.