-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert tick-setting methods to docstrings #9192
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
Changes from 1 commit
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 |
---|---|---|
|
@@ -2993,24 +2993,39 @@ def set_xticks(self, ticks, minor=False): | |
""" | ||
Set the x ticks with list of *ticks* | ||
|
||
ACCEPTS: sequence of floats | ||
Parameters | ||
---------- | ||
ticks : sequence | ||
Sequence of ticks | ||
|
||
minor : bool, optional | ||
If ``False`` sets major ticks, if ``True`` sets minor ticks. | ||
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 this can also take the string 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. on second thought, that makes not much sense for this |
||
Default is ``False``. | ||
""" | ||
ret = self.xaxis.set_ticks(ticks, minor=minor) | ||
self.stale = True | ||
return ret | ||
|
||
def get_xmajorticklabels(self): | ||
""" | ||
Get the xtick labels as a list of :class:`~matplotlib.text.Text` | ||
instances. | ||
Get the xtick major labels | ||
|
||
Returns | ||
------- | ||
labels : list | ||
List of :class:`~matplotlib.text.Text` instancess | ||
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. "instacesssss" |
||
""" | ||
return cbook.silent_list('Text xticklabel', | ||
self.xaxis.get_majorticklabels()) | ||
|
||
def get_xminorticklabels(self): | ||
""" | ||
Get the x minor tick labels as a list of | ||
:class:`matplotlib.text.Text` instances. | ||
Get the x minor tick labels | ||
|
||
Returns | ||
------- | ||
labels : list | ||
List of :class:`~matplotlib.text.Text` instances | ||
""" | ||
return cbook.silent_list('Text xticklabel', | ||
self.xaxis.get_minorticklabels()) | ||
|
@@ -3299,28 +3314,38 @@ def set_yticks(self, ticks, minor=False): | |
""" | ||
Set the y ticks with list of *ticks* | ||
|
||
ACCEPTS: sequence of floats | ||
|
||
Keyword arguments: | ||
Parameters | ||
---------- | ||
ticks : sequence | ||
Sequence of ticks | ||
|
||
*minor*: [ *False* | *True* ] | ||
Sets the minor ticks if *True* | ||
minor : bool, optional | ||
If ``False`` sets major ticks, if ``True`` sets minor ticks. | ||
Default is ``False``. | ||
""" | ||
ret = self.yaxis.set_ticks(ticks, minor=minor) | ||
return ret | ||
|
||
def get_ymajorticklabels(self): | ||
""" | ||
Get the major y tick labels as a list of | ||
:class:`~matplotlib.text.Text` instances. | ||
Get the major y tick labels | ||
|
||
Returns | ||
------- | ||
labels : list | ||
List of :class:`~matplotlib.text.Text` instancess | ||
""" | ||
return cbook.silent_list('Text yticklabel', | ||
self.yaxis.get_majorticklabels()) | ||
|
||
def get_yminorticklabels(self): | ||
""" | ||
Get the minor y tick labels as a list of | ||
:class:`~matplotlib.text.Text` instances. | ||
Get the minor y tick labels | ||
|
||
Returns | ||
------- | ||
labels : list | ||
List of :class:`~matplotlib.text.Text` instancess | ||
""" | ||
return cbook.silent_list('Text yticklabel', | ||
self.yaxis.get_minorticklabels()) | ||
|
@@ -3389,8 +3414,10 @@ def xaxis_date(self, tz=None): | |
""" | ||
Sets up x-axis ticks and labels that treat the x data as dates. | ||
|
||
*tz* is a timezone string or :class:`tzinfo` instance. | ||
Defaults to rc value. | ||
Parameters | ||
---------- | ||
tz : string or :class:`tzinfo` instance, optional | ||
Timezone string or timezone. Defaults to rc value. | ||
""" | ||
# should be enough to inform the unit conversion interface | ||
# dates are coming in | ||
|
@@ -3400,8 +3427,10 @@ def yaxis_date(self, tz=None): | |
""" | ||
Sets up y-axis ticks and labels that treat the y data as dates. | ||
|
||
*tz* is a timezone string or :class:`tzinfo` instance. | ||
Defaults to rc value. | ||
Parameters | ||
---------- | ||
tz : string or :class:`tzinfo` instance, optional | ||
Timezone string or timezone. Defaults to rc value. | ||
""" | ||
self.yaxis.axis_date(tz) | ||
|
||
|
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 would just say list... and list of floats (I guess?), as it's not a list of Tick objects (unless I got this completely wrong).
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 be a list of datetimes if it's a date axis?
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.
Possibly, no idea.
But "ticks" without further qualification definitely sounds like "Tick objects" to me.