Opened 10 years ago
Closed 20 months ago
#11160 closed defect (duplicate)
Graphics Array needs suboptions to show
Reported by: | kcrisman | Owned by: | jason, was |
---|---|---|---|
Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
Component: | graphics | Keywords: | |
Cc: | jason, jsrn, jhonrubia6, chapoton | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
p1=plot(x^2, (x, -pi, pi), color='blue',legend_label="f") G=graphics_array(((p1,p1),(p1,p1))) G.show(figsize=[8,8]) Traceback (click to the left of this block for traceback) ... KeyError: 'pop(): dictionary is empty'
This is reported at this sage-support thread.
I think the fix should be the same as at #10244, but for the GraphicsArray class.
Related tickets:
Attachments (1)
Change History (18)
comment:1 Changed 10 years ago by
comment:2 follow-up: ↓ 3 Changed 10 years ago by
Adding the suboptions we usually send to save to the normal !Graphics class matplotlib removes the error, but does the following - see attached graphic. I don't have time to do any more with this now, though.
comment:3 in reply to: ↑ 2 Changed 10 years ago by
Replying to kcrisman:
Adding the suboptions we usually send to save to the normal !Graphics class matplotlib removes the error, but does the following - see attached graphic. I don't have time to do any more with this now, though.
I should add that my code was slightly simpler:
sage: p = plot(x,legend_label='f') sage: G = graphics_array((p,p)) sage: G
comment:4 Changed 10 years ago by
- Cc jason added
comment:5 Changed 10 years ago by
- Cc jsrn added
This is a bug which might be related:
sage: g = Graphics() sage: g += plot(x,legend_label='f') sage: g.set_legend_options(title="Nice") sage: G = graphics_array((g,g)) sage: G.show() ... KeyError: 'font_family'
It seems that this part of the problem might be completely solved by adding the suboptions usually added when show()'ing a graphics object.
comment:6 Changed 9 years ago by
- Description modified (diff)
comment:7 Changed 5 years ago by
- Cc jhonrubia6 added
comment:8 Changed 23 months ago by
The issue described here is fixed in #27865.
comment:9 Changed 21 months ago by
- Cc fchapoton added
- 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:10 Changed 21 months ago by
- Cc chapoton added; fchapoton removed
comment:11 follow-up: ↓ 12 Changed 21 months ago by
All the examples listed here work fine in the newest develop, at least.
comment:12 in reply to: ↑ 11 Changed 21 months ago by
Replying to jsrn:
All the examples listed here work fine in the newest develop, at least.
Then maybe you could set this ticket to positive review, given its status is "sage-duplicate/invalid/wontfix" (the positive review is necessary to close it).
comment:13 follow-up: ↓ 14 Changed 20 months ago by
Any doctests necessary or are they all included in #27865 as I suspect?
comment:14 in reply to: ↑ 13 Changed 20 months ago by
Replying to kcrisman:
Any doctests necessary or are they all included in #27865 as I suspect?
Yes the doctests relevant to this ticket are included in #27865; in Sage 8.9.beta6, you can find them in lines 3481 - 3499 of src/sage/plot/plot.py
:
sage: L = [plot(sin(k*x), (x,-pi,pi)) for k in [1..3]] sage: ga = graphics_array(L) sage: ga.show(figsize=[5,3]) # smallish and compact sage: ga.show(figsize=[5,7]) # tall and thin; long time sage: ga.show(figsize=4) # width=4 inches, height fixed from default aspect ratio
as well as in lines 555-613 of src/sage/plot/multigraphics.py
:
sage: g1 = plot(sin(x^2), (x, 0, 6), axes_labels=['$x$', '$y$'], ....: axes=False, frame=True, gridlines='minor') sage: y = var('y') sage: g2 = streamline_plot((sin(x), cos(y)), (x,-3,3), (y,-3,3), ....: aspect_ratio=1) sage: g3 = graphs.DodecahedralGraph().plot() sage: g4 = polar_plot(sin(5*x)^2, (x, 0, 2*pi), color='green', ....: fontsize=8) \ ....: + circle((0,0), 0.5, rgbcolor='red', fill=True, alpha=0.1, ....: legend_label='pink') sage: g4.set_legend_options(loc='upper right') sage: G = graphics_array([g1, g2, g3, g4]) sage: G.show(figsize=[8, 3])
comment:15 Changed 20 months ago by
I only asked because maybe that is why someone hasn't hit positive review. So I guess jsrn should :-) or actually you could as well, I think.
comment:16 Changed 20 months ago by
comment:17 Changed 20 months ago by
- Resolution set to duplicate
- Status changed from needs_review to closed
Hmm, but that doesn't work... but it must be a similar issue, anyway.