Opened 13 years ago
Closed 12 years ago
#8019 closed defect (invalid)
rendering a plot changes its dimensions [was: graphics_array messes up dimensions of plots]
Reported by: | pdehaye | Owned by: | was |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | graphics | Keywords: | axes_range, axes_pad |
Cc: | Merged in: | ||
Authors: | Paul Dehaye | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
The following code should illustrate this, see picture below, everything gets scaled for no reason.
graph = circle((0,0),20) graph.set_aspect_ratio(1) graph2 = graphics_array([[graph]*4]*4) graph2.show()
The real reason is that axes_pad<>0 will affect the same picture every time it's rendered (to be saved or displayed), and change its dimensions by 2% each time by default. I can understand the need for axes_pad, but don't think this should happen:
graph = circle((0,0),20) graph.show() print graph.get_axes_range() graph.save('test.png') graph.save('test.png') graph.save('test.png') graph.save('test.png') graph.save('test.png') print graph.get_axes_range() graph.show()
and compare with
graph = circle((0,0),20) graph.show(axes_pad=0) print graph.get_axes_range() graph.save('test.png',axes_pad=0) graph.save('test.png',axes_pad=0) graph.save('test.png',axes_pad=0) graph.save('test.png',axes_pad=0) graph.save('test.png',axes_pad=0) print graph.get_axes_range() graph.show(axes_pad=0)
Attachments (1)
Change History (5)
Changed 13 years ago by
Attachment: | circles.png added |
---|
comment:1 Changed 13 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Keywords: | axes_range axes_pad added; graphics_array scale removed |
Priority: | minor → major |
Summary: | graphics_array messes up dimensions of plots → rendering a plot changes its dimensions [was: graphics_array messes up dimensions of plots] |
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Milestone: | sage-4.6.1 → sage-duplicate/invalid/wontfix |
---|---|
Resolution: | → invalid |
Status: | new → closed |
This has been fixed by #10291.
Note: See
TracTickets for help on using
tickets.
I think the problem is that in the save routine (actually, in the .matplotlib() method), the x and y limits are changed according to the axes_pad setting. Instead, they should be temporarily changed and then changed back so that the graphic has the same x and y limits as it did when starting.