Opened 9 years ago

Closed 4 weeks ago

#10657 closed defect (fixed)

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

Reported by: niles Owned by: jason, was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: GraphicsArray, matplotlib
Cc: kcrisman, paulmasson, chapoton Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by kcrisman)

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 eviatarbach 8 years ago.
Picture of bug

Download all attachments as: .zip

Change History (21)

comment:1 Changed 9 years ago by niles

  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 9 years ago by kcrisman

  • Cc kcrisman added

comment:3 follow-up: Changed 8 years ago by 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)

Changed 8 years ago by eviatarbach

Picture of bug

comment:4 Changed 8 years ago by kcrisman

  • Description modified (diff)

comment:5 in reply to: ↑ 3 Changed 8 years ago by kcrisman

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 7 years ago by ppurka

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 6 years ago by kcrisman

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 5 years ago by kcrisman

Here is another report, by a seasoned Sage user.

comment:9 Changed 5 years ago by kcrisman

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

comment:10 Changed 5 years ago by kcrisman

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 4 years ago by kcrisman

This post is probably also the same thing.

comment:12 Changed 3 years ago by paulmasson

  • Cc paulmasson added

comment:13 Changed 3 years ago by kcrisman

Here is yet another example.

comment:14 Changed 2 years ago by kcrisman

This example is probably the same thing.

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

comment:15 Changed 23 months ago by kcrisman

comment:16 Changed 4 months ago by egourgoulhon

The issues described here are fixed in #27865.

comment:17 Changed 2 months ago by egourgoulhon

  • Milestone set to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

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

comment:18 Changed 2 months ago by egourgoulhon

  • Cc fchapoton added

comment:19 Changed 2 months ago by egourgoulhon

  • Cc chapoton added; fchapoton removed

comment:20 Changed 4 weeks ago by chapoton

  • Resolution set to fixed
  • Status changed from needs_review to closed
Note: See TracTickets for help on using tickets.