Fixed large pcolormesh rendering with bbox_inches='tight'.#4045
Fixed large pcolormesh rendering with bbox_inches='tight'.#4045tacaswell merged 1 commit intomatplotlib:v1.4.xfrom
Conversation
|
This does not account for having a non-trivial |
Can you provide a simple example? I've never properly understood the offsets in some collection contexts. |
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
X, Y = np.meshgrid(range(25), range(20))
C = np.random.rand(*X.shape)
offsets = (np.random.randn(2, 24*19)
ax.pcolormesh(X, Y, C, offsets=offsets, transOffset=ax.transData)which has an odd extra shift from (0, 0) to (3, 2.3) for the lower left. I am also not really clear on why this is useful, but it is something that the code does. |
|
The code for this in agg ends up in c++ layer and gets really hairy really fast. |
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
X, Y = np.meshgrid(range(25), range(20))
C = np.random.rand(*X.shape)
offsets = np.random.randn(24*19, 2) * .1
ax.pcolormesh(X, Y, C)#, offsets=offsets, transOffset=ax.transData)
fig.savefig('so.png', bbox_inches='tight')gives me |
There was a problem hiding this comment.
I think this line should be return Bbox(self..transform(bbox.get_points()))
|
Thanks for the example @tacaswell. I did not know you could do that! |
|
I concur about the trade off. |
BUG : Fix run-away memory usage with pcolormesh + bbox_inches='tight'

Replaces #4017.
Closes #3095.