10000 Polar documentation by AdamsonMA · Pull Request #10795 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 7 commits into from
Closed

Conversation

AdamsonMA
Copy link

PR Summary

Added documentation to undocumented methods in the Polar.py file for creating polar charts.

PR Checklist

  • [ N/A] Has Pytest style unit tests
  • [N/A ] Code is PEP 8 compliant
  • [Yes ] New features are documented, with examples if plot related
  • [ Yes] Documentation is sphinx and numpydoc compliant
  • [N/A ] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [ N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Matt Adamson and others added 4 commits March 13, 2018 22:30
Copy link
Member
@jklymak jklymak left a 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(?)

@@ -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
----------
Copy link
Member

Choose a reason for hiding this comment

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

Missing Parameters?

return self._originViewLim.y0

def set_rlim(self, *args, **kwargs):

"""Set the minimum and maxium radius
----------
Copy link
Member

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



Copy link
Member

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?

@AdamsonMA
Copy link
Author

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.
Copy link
Member
@timhoffm timhoffm left a 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.

@@ -235,7 +235,6 @@ def get_tick_space(self):
class ThetaLocator(mticker.Locator):
"""
Used to locate theta ticks.

Copy link
Member

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.

1:
Theta increases in the counterclockwise direction
"""
return self._direction.get_matrix()[0, 0]

def set_rmax(self, rmax):
"""Updates the maximum radius
Parameters
Copy link
Member

Choose a reason for hiding this comment

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

Missing blank line.

1:
Theta increases in the counterclockwise direction
"""
return self._direction.get_matrix()[0, 0]

def set_rmax(self, rmax):
"""Updates the maximum radius
Copy link
Member

Choose a reason for hiding this comment

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

"Update the maximum radius."

PEP-257:

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
Copy link
Member
@dstansby dstansby left a 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.

@@ -275,12 +270,12 @@ def zoom(self, direction):
class ThetaTick(maxis.XTick):
"""
A theta-axis tick.

Copy link
Member

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)


Parameters
----------
rmin = 0
Copy link
Member

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.

Copy link
Author

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
Copy link
Member
@dstansby dstansby left a 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'




Copy link
Member

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



Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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.

Copy link
Member

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”.

@dstansby
Copy link
Member

I've fixed and applied the changes here: #14261. Thanks for the original pull request @AdamsonMA

@dstansby dstansby closed this May 20, 2019
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.

5 participants
0