Opened 8 years ago

Last modified 3 years ago

#11160 new defect

Graphics Array needs suboptions to show

Reported by: kcrisman Owned by: jason, was
Priority: minor Milestone:
Component: graphics Keywords:
Cc: jason, jsrn, jhonrubia6 Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by kcrisman)

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:

  • #10656 - Graphics Arrays should be able to become Graphics objects
  • #10657 - options should be passed to all graphics, and they should be set separately if desired

Attachments (1)

tmp_0.png (16.0 KB) - added by kcrisman 8 years ago.
Note the second graph has two legends for the same function!

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by kcrisman

Hmm, but that doesn't work... but it must be a similar issue, anyway.

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

Changed 8 years ago by kcrisman

Note the second graph has two legends for the same function!

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

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 8 years ago by jason

  • Cc jason added

comment:5 Changed 8 years ago by jsrn

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

  • Description modified (diff)

comment:7 Changed 3 years ago by jhonrubia6

  • Cc jhonrubia6 added
Note: See TracTickets for help on using tickets.