Opened 13 years ago

Closed 12 years ago

# rendering a plot changes its dimensions [was: graphics_array messes up dimensions of plots]

Reported by: Owned by: pdehaye was major sage-duplicate/invalid/wontfix graphics axes_range, axes_pad Paul Dehaye N/A

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)
print graph.get_axes_range()
print graph.get_axes_range()
```

### comment:1 Changed 13 years ago by pdehaye

Description: modified (diff)

### comment:2 Changed 13 years ago by pdehaye

Description: modified (diff) axes_range axes_pad added; graphics_array scale removed minor → major 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 jason

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.

### comment:4 Changed 12 years ago by mhansen

Milestone: sage-4.6.1 → sage-duplicate/invalid/wontfix → invalid new → closed

This has been fixed by #10291.

Note: See TracTickets for help on using tickets.