-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Polar documentation #10795
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
Polar documentation #10795
Conversation
Added documentation to set_rlim and other undocumented functions
…o polar-documentation
… polar-documentation
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.
These look fine modulo a couple typos(?)
lib/matplotlib/projections/polar.py
Outdated
@@ -1092,6 +1082,14 @@ def get_thetamin(self): | |||
return np.rad2deg(self.viewLim.xmin) | |||
|
|||
def set_thetalim(self, *args, **kwargs): | |||
"""Set the minimum and maxium radius | |||
---------- |
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.
Missing Parameters?
lib/matplotlib/projections/polar.py
Outdated
return self._originViewLim.y0 | ||
|
||
def set_rlim(self, *args, **kwargs): | ||
|
||
"""Set the minimum and maxium radius | ||
---------- |
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.
Missing Parameters?
@@ -1411,6 +1433,7 @@ def drag_pan(self, button, key, x, y): | |||
PolarAxes.ThetaLocator = ThetaLocator | |||
|
|||
|
|||
|
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.
Will PEP8 get mad about the extra line?
Thanks for the fast feedback. It looks like someone else fixed the set_thetatlim documentation. I'll fix the typo comments and delete the extra empty line at the end. |
Fixed Typos, deleted empty line at end.
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.
Sorry for being a bit picky, but I think there's great value in having a consistent documentation. And since PEP-8 and PEP-257 give detailed conventions, we try to follow them.
lib/matplotlib/projections/polar.py
Outdated
@@ -235,7 +235,6 @@ def get_tick_space(self): | |||
class ThetaLocator(mticker.Locator): | |||
""" | |||
Used to locate theta ticks. | |||
|
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.
Please keep the empty lines. PEP-257:
Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description.
lib/matplotlib/projections/polar.py
Outdated
1: | ||
Theta increases in the counterclockwise direction | ||
""" | ||
return self._direction.get_matrix()[0, 0] | ||
|
||
def set_rmax(self, rmax): | ||
"""Updates the maximum radius | ||
Parameters |
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.
Missing blank line.
lib/matplotlib/projections/polar.py
Outdated
1: | ||
Theta increases in the counterclockwise direction | ||
""" | ||
return self._direction.get_matrix()[0, 0] | ||
|
||
def set_rmax(self, rmax): | ||
"""Updates the maximum radius |
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.
"Update the maximum radius."
The docstring is a phrase ending in a period. It prescribes the function or method's effect as a command ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...".
Fixed spacing errors
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.
👍 Thanks for working on this! Overall it looks good, just a few tweaks needed.
lib/matplotlib/projections/polar.py
Outdated
@@ -275,12 +270,12 @@ def zoom(self, direction): | |||
class ThetaTick(maxis.XTick): | |||
""" | |||
A theta-axis tick. | |||
|
|||
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.
Could these tabs turn back into empty blank lines? (so there shouldn't be any diff on the lines)
lib/matplotlib/projections/polar.py
Outdated
|
||
Parameters | ||
---------- | ||
rmin = 0 |
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 should be rmin : float, optional
, and then the default value should be mentioned in the sentence below. I'm not sure there is a default value though, so here I think the 0 can just be omitted.
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.
Thank you for your patience as this my first PR! Hopefully I will make future PR's much faster. Will finish this today.
Deleted tabs in multiline comments, updated line 1233 parameters
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.
A couple of random extra lines need changing back, but otherwise looks good!
@@ -986,6 +981,9 @@ def get_xaxis_text1_transform(self, pad): | |||
def get_xaxis_text2_transform(self, pad): | |||
return self._xaxis_text_transform, 'center', 'center' | |||
|
|||
|
|||
|
|||
|
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.
These new new-lines need removing.
@@ -1411,6 +1456,7 @@ def drag_pan(self, button, key, x, y): | |||
PolarAxes.ThetaLocator = ThetaLocator | |||
|
|||
|
|||
|
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 extra line, and the ones removed above need to be changed back too.
Parameters | ||
---------- | ||
rmin : number | ||
Set minimumradius to value rmin. |
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.
Missing space between words.
Returns | ||
------- | ||
float | ||
The minimum radius of chart. |
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.
I don't think we've ever used the word 'chart' to describe our plots before (except when referring to a specific type of plot, like a pie chart.) This could be something like "the minimum data radius" or something that matches the Cartesian form, but in any case, I don't think we should use 'chart' for these.
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.
I think we use “polar plot” and “radar chart”.
I've fixed and applied the changes here: #14261. Thanks for the original pull request @AdamsonMA |
PR Summary
Added documentation to undocumented methods in the Polar.py file for creating polar charts.
PR Checklist