-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Expose symlog scaling in plotting API #24968
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
Merged
jreback
merged 14 commits into
pandas-dev:master
from
charlesdong1991:issue_backupbackup
Apr 12, 2019
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
88705a5
merge master
charlesdong1991 7bf16e4
add quote
charlesdong1991 446bcc0
change error message
charlesdong1991 238d1f4
change test
charlesdong1991 8941bdf
optimize
charlesdong1991 f8b124a
push change
charlesdong1991 549dd4d
fix test error
charlesdong1991 0ea6653
fix tests
charlesdong1991 8b9ede1
fix conflict
charlesdong1991 3a265e9
add docstring
charlesdong1991 a3e71c9
parametrize tests
charlesdong1991 9c205f5
xref 25586
charlesdong1991 d0e5c41
add testing
charlesdong1991 5170000
add blank line after version change
charlesdong1991 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,8 +288,10 @@ def _maybe_right_yaxis(self, ax, axes_num): | |
if not self._has_plotted_object(orig_ax): # no data on left y | ||
orig_ax.get_yaxis().set_visible(False) | ||
|
||
if self.logy or self.loglog: | ||
if self.logy is True or self.loglog is True: | ||
new_ax.set_yscale('log') | ||
elif self.logy == 'sym' or self.loglog == 'sym': | ||
new_ax.set_yscale('symlog') | ||
return new_ax | ||
|
||
def _setup_subplots(self): | ||
|
@@ -311,10 +313,24 @@ def _setup_subplots(self): | |
|
||
axes = _flatten(axes) | ||
|
||
if self.logx or self.loglog: | ||
valid_log = {False, True, 'sym', None} | ||
input_log = {self.logx, self.logy, self.loglog} | ||
if input_log - valid_log: | ||
invalid_log = next(iter((input_log - valid_log))) | ||
raise ValueError( | ||
"Boolean, None and 'sym' are valid options," | ||
" '{}' is given.".format(invalid_log) | ||
) | ||
|
||
if self.logx is True or self.loglog is True: | ||
[a.set_xscale('log') for a in axes] | ||
if self.logy or self.loglog: | ||
elif self.logx == 'sym' or self.loglog == 'sym': | ||
[a.set_xscale('symlog') for a in axes] | ||
|
||
if self.logy is True or self.loglog is True: | ||
[a.set_yscale('log') for a in axes] | ||
elif self.logy == 'sym' or self.loglog == 'sym': | ||
[a.set_yscale('symlog') for a in axes] | ||
|
||
self.fig = fig | ||
self.axes = axes | ||
|
@@ -1909,12 +1925,15 @@ def _plot(data, x=None, y=None, subplots=False, | |
Place legend on axis subplots | ||
style : list or dict | ||
matplotlib line style per column | ||
logx : bool, default False | ||
Use log scaling on x axis | ||
logy : bool, default False | ||
Use log scaling on y axis | ||
loglog : bool, default False | ||
Use log scaling on both x and y axes | ||
logx : bool or 'sym', default False | ||
Use log scaling or symlog scaling on x axis | ||
.. versionadded:: 0.25.0 | ||
logy : bool or 'sym' default False | ||
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. need a blank line after the versionadded (for each of these); make these versionchanged |
||
Use log scaling or symlog scaling on y axis | ||
.. versionadded:: 0.25.0 | ||
loglog : bool or 'sym', default False | ||
Use log scaling or symlog scaling on both x and y axes | ||
.. versionadded:: 0.25.0 | ||
xticks : sequence | ||
Values to use for the xticks | ||
yticks : sequence | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.