You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this code, patch is a collection of patches so patch[0] has calls set_snap(False) while the patch[1:] are left with the default snapping which is set.
The set_snap(False) appears to be a fix for issue #408. @mdboom, perhaps you can take a look. It seemed like you had an idea on the real fix from one of your comments.
I was about to post on mailing, but now I see it was already reported.
One detail: I can only reproduce it in a Notebook (inline backend), not in a regular script. Is it clear why ? (In both cases, I have collection[0].get_snap() returning False )
It's depending on snapping to pixel borders so it's going to depend on the exact size of the plot you are creating how vissible this is. The inline backend trims to plot to remove whitespace
right. I didn't find the relevant rcParams which are changed by the %matplotlib inline magic. I noticed 'figsize' was reduced from (8,6) to (6,4), but there is something else: the png from notebook has much less pixels than the png from a script.
The inline backend is defined in IPython. It passes bbox_inches='tight' to savefig which crops off any whitespace on the figure making it smaller than the requested size.
Activity
cimarronm commentedon Mar 12, 2015
The problem occurs only on the first bin as that patch has
_snapset toFalsewhile the other patches do not. This occurs from withinaxes.histcode:In this code,
patchis a collection of patches sopatch[0]has callsset_snap(False)while thepatch[1:]are left with the default snapping which is set.The
set_snap(False)appears to be a fix for issue #408. @mdboom, perhaps you can take a look. It seemed like you had an idea on the real fix from one of your comments.cimarronm commentedon Mar 12, 2015
@tritemio, as a workaround for your issue you can replace the
plt.histcommand with the following to get what you were expectingtritemio commentedon Mar 12, 2015
@cimarronm thanks for the workaround! I hope this bug will be fixed soon (definitely before the next release) as it can be pretty embarrassing.
pierre-haessig commentedon Aug 31, 2016
I was about to post on mailing, but now I see it was already reported.
One detail: I can only reproduce it in a Notebook (inline backend), not in a regular script. Is it clear why ? (In both cases, I have
collection[0].get_snap()returningFalse)jenshnielsen commentedon Aug 31, 2016
It's depending on snapping to pixel borders so it's going to depend on the exact size of the plot you are creating how vissible this is. The inline backend trims to plot to remove whitespace
pierre-haessig commentedon Aug 31, 2016
right. I didn't find the relevant rcParams which are changed by the %matplotlib inline magic. I noticed 'figsize' was reduced from (8,6) to (6,4), but there is something else: the png from notebook has much less pixels than the png from a script.
jenshnielsen commentedon Aug 31, 2016
The inline backend is defined in IPython. It passes bbox_inches='tight' to savefig which crops off any whitespace on the figure making it smaller than the requested size.
efiring commentedon Sep 6, 2016
Closed by #6887.