-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Sticky margins #7476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sticky margins #7476
Changes from 1 commit
b73a939
a2e35cc
0fa187e
e646152
5d82bcb
16cba9d
eb1ce75
1285264
253eac3
fbf97d4
5f942c8
36fcfe5
70a37f1
1a50dda
717c278
840986e
1a86b08
04298b8
93c1bd8
360dba7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2203,7 +2203,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True): | |
self._tight = bool(tight) | ||
|
||
if self._xmargin or self._ymargin: | ||
stickies = [artist.stickies for artist in self.get_children()] | ||
stickies = [artist.sticky_edges for artist in self.get_children()] | ||
x_stickies = sum([sticky.x for sticky in stickies], []) | ||
y_stickies = sum([sticky.y for sticky in stickies], []) | ||
if self.get_xscale().lower() == 'log': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the presence of negative stickies with log scale raise an error? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not any more than negative values in a plot do, I think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I think it is a bug that we tolerate this :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @NelleV, you think that if a histogram plot is switched to a log scale it should fail rather than yielding a plot? In other words, simply bumping the "L" key when a histogram plot is active should raise an exception? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it means that the following code raises an error, then yes I think it should. import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots()
ax.set_yscale("log")
ax.plot(np.arange(0, 10))
ax.plot(np.arange(-100, 0)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the behavior proposed by @NelleV is reasonable but this should not be handled by the sticky system (nor block this PR) -- it should affect all plots, including those who do not set sticky margins. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this better written as
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is 🚲 🏠 ing, treat as such
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best to use np.concatenate.