8000 improve docstring of Axes.loglog, Axes.semilogx, Axes.semilogy by timhoffm · Pull Request #10278 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

improve docstring of Axes.loglog, Axes.semilogx, Axes.semilogy #10278

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
merged 3 commits into from
Mar 16, 2018

Conversation

timhoffm
Copy link
Member

PR Summary

As part of #10148: Docstring update for Axes.loglog, Axes.semilogx and Axes.semilogy.


Parameters
----------
basex, basey : scalar
basex, basey : scalar, optional, default 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"must be >1" is actually not true (although this could arguably be discussed in a separate issue)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I write something else? The semilogx/y use the weaker phrase "The value should be larger than 1.".

I tested that I can generate plots with 0 < base < 1. No idea if there's a use-case for that. Negative values are accepted, but generate an error when drawing the plot (problably when updating the axes). Invalid values should be rejected by set_xscale (or probably a level deeper, which I didn't follow through). Should I open an issue on that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there isn't any real reason to reject 0<base<1, but given that base==1 won't work (of course), it may be simpler to indeed just spec base>1, or not say anything about it.
I think that's the job of the scale classes anyways.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll remove it. It's not particularly helpful, to say something about the allowed values. People will know what base they want. And the scales should complain if they cannot handle it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Removed. This is not reflected here, because it's on the next line.

@tacaswell tacaswell added this to the v2.2 milestone Jan 21, 2018
Copy link
Member
@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some typos.


nonposx, nonposy : ['mask' | 'clip' ]
nonposx, nonposy : [ 'mask' | 'clip' ], optional, default 'mask'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to braces now?

details.
The location of the minor xticks. *None* defaults to autosubs,
which depend on the number of decades in the plot. See
`.Axes.set_xscale` for setails.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

details

nonposx : string, optional, {'mask', 'clip'}
Non-positive values in x can be masked as
invalid, or clipped to a very small positive number.
nonposx : [ 'mask' | 'clip' ], optional, default 'mask'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Braces.

details.
The location of the minor yticks. *None* defaults to autosubs,
which depend on the number of decades in the plot. See
`.Axes.set_yscale` for setails.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

details

nonposy : string, optional, {'mask', 'clip'}
Non-positive values in *y* can be masked as
invalid, or clipped to a very small positive number.
nonposy : [ 'mask' | 'clip' ], optional, default 'mask'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Braces.

@QuLogic
Copy link
Member
QuLogic commented Feb 4, 2018

Not sure it was the last commit you wanted to amend this time.

@timhoffm
Copy link
Member Author
timhoffm commented Feb 4, 2018

@QuLogic Not really. But I just learned to amend a non-last commit. Anyway I don't think it's too bad as it is. Or do you want me to rewrite the commits?

@QuLogic
Copy link
Member
QuLogic commented Feb 13, 2018

Just makes for an odd commit description, but it's up to you.

@timhoffm timhoffm force-pushed the axes-doc-log branch 2 times, most recently from 1ed6f21 to 3a319b4 Compare February 25, 2018 16:09
see :meth:`matplotlib.axes.Axes.set_xscale` /
:meth:`matplotlib.axes.Axes.set_yscale` for details.
subsx, subsy : sequence, optional
The location of the minor x/y ticks; *None* defaults to autosubs,
Copy link
Contributor
@anntzer anntzer Mar 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"autosubs" is actually never defined... (same for semilogx/y)

@@ -253,6 +253,8 @@ def __init__(self, axis, **kwargs):

if nonpos not in ['mask', 'clip']:
raise ValueError("nonposx, nonposy kwarg must be 'mask' or 'clip'")
if base <= 0 or base == 1:
raise ValueError('The log base cannot be <= 0 or == 1.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no final dot in error messages

@anntzer anntzer modified the milestones: needs sorting, v2.2-doc Mar 3, 2018
@tacaswell
Copy link
Member

The -doc milestone is for rst related changes only.

@tacaswell tacaswell merged commit 2653ce8 into matplotlib:master Mar 16, 2018
lumberbot-app bot pushed a commit that referenced this pull request Mar 16, 2018
timhoffm added a commit that referenced this pull request Mar 16, 2018
@timhoffm timhoffm deleted the axes-doc-log branch March 18, 2018 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0