Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reformatted documentation of related function
  • Loading branch information
VincentVandalon committed Mar 1, 2016
commit 4079e1ab9ba4a54a8b1b87973b4cd59bddce3b08
78 changes: 65 additions & 13 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,21 @@ def get_useScalingFactor(self):

def set_useScalingFactor(self,val):
"""
Takes (True|False|numeric value) as argument.
Enable, disable, or sets and enables the use of scaling factor
in the axis.
Control and set the scaling factor. Disabling this returns the
formatter to its default behavior, e.g. it will try to find
an appropriate scaling/offset if enabled.
Note that either offset or scaling can be used. Therefore,
this automatically turns off offset

Parameters
----------
val : (True|False|numeric)
Enable, disable, or sets and enables the use of scaling factor
in the axis.

Returns
-------
NONE
"""

if val in [True, False]:
Expand All @@ -471,11 +481,21 @@ def get_useOffset(self):

def set_useOffset(self, val):
"""
Takes (True|False|numeric value) as argument.
Enable, disable, or sets and enables the use of an offset
in the axis.
Control and set the offset. Disabling this returns the
formatter to its default behavior, e.g. it will try to find
an appropriate scaling/offset if enabled.
Note that either offset or scaling can be used. Therefore,
this automatically turns off scaling factor
this automatically turns off scaling

Parameters
----------
val : (True|False|numeric)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

val : bool or scaler I think in the right numpydoc way to write this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

scalar not scaler.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Enable, disable, or sets and enables the use of an offset
in the axis.

Returns
-------
NONE
"""
if val in [True, False]:
self.offsetval = 0
Expand Down Expand Up @@ -518,20 +538,39 @@ def __call__(self, x, pos=None):
return self.fix_minus(s)

def set_scientific(self, b):
'''True or False to turn scientific notation on or off
"""
Enable/disable scientific notation
see also :meth:`set_powerlimits`
'''

Parameters
----------
b : (True|False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just b : bool

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Enable, disable scientific notation

Returns
-------
NONE
"""
self._scientific = bool(b)

def set_powerlimits(self, lims):
'''
"""
Sets size thresholds for scientific notation.

e.g., ``formatter.set_powerlimits((-3, 4))`` sets the pre-2007 default
in which scientific notation is used for numbers less than 1e-3 or
greater than 1e4.
See also :meth:`set_scientific`.
'''

Parameters
----------
lims : (number,number)
tuple with upper and lower limit triggering scientific notation

Returns
-------
NONE
"""

if len(lims) != 2:
raise ValueError("'lims' must be a sequence of length 2")
self._powerlimits = lims
Expand All @@ -554,7 +593,20 @@ def format_data(self, value):


def get_offset(self):
"""Return scientific notation, plus offset"""
"""
Returns a string with the offset(or scientific notation)/scaling
factor which is properly formatted. This is used as additional text
next to the ticks.

Parameters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do not include unneeded sections.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I am not sure if you mean (1) leave it as it was or (2) no documentation needed for this method as a user will probably not use this method. Which one do you prefer?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The rest of the docstring is good, just do not include the Parameters section (as there ane no parameters).

----------
NONE

Returns
-------
:string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no : here

"""

if len(self.locs) == 0:
return ''
s = ''
Expand Down