|
New release
|
|
matplotlib 0.98.1 is a major release which requires python2.4 or 2.5 and numpy 1.1. It contains significant improvements and may require some advanced users to update their code; see migration and API_CHANGES. We are supporting a maintenance branch of the older code available at matplotlib 0.91.4. Basemap users see basemap-readme for upgrade instructions |
|
Donate
|
|
Help support matplotlib development by donating to fund developer sprints and other matplotlib development costs. |
|
|
|
Tick locating and formatting
============================
This module contains classes to support completely configurable tick
locating and formatting. Although the locators know nothing about
major or minor ticks, they are used by the Axis class to support major
and minor tick locating and formatting. Generic tick locators and
formatters are provided, as well as domain specific custom ones..
Tick locating
-------------
The Locator class is the base class for all tick locators. The
locators handle autoscaling of the view limits based on the data
limits, and the choosing of tick locations. A useful semi-automatic
tick locator is MultipleLocator. You initialize this with a base, eg
10, and it picks axis limits and ticks that are multiples of your
base.
The Locator subclasses defined here are
* NullLocator - No ticks
* FixedLocator - Tick locations are fixed
* IndexLocator - locator for index plots (eg where x = range(len(y))
* LinearLocator - evenly spaced ticks from min to max
* LogLocator - logarithmically ticks from min to max
* MultipleLocator - ticks and range are a multiple of base;
either integer or float
* OldAutoLocator - choose a MultipleLocator and dyamically reassign
it for intelligent ticking during navigation
* MaxNLocator - finds up to a max number of ticks at nice
locations
* AutoLocator - MaxNLocator with simple defaults. This is the
default tick locator for most plotting.
There are a number of locators specialized for date locations - see
the dates module
You can define your own locator by deriving from Locator. You must
override the __call__ method, which returns a sequence of locations,
and you will probably want to override the autoscale method to set the
view limits from the data limits.
If you want to override the default locator, use one of the above or a
custom locator and pass it to the x or y axis instance. The relevant
methods are::
ax.xaxis.set_major_locator( xmajorLocator )
ax.xaxis.set_minor_locator( xminorLocator )
ax.yaxis.set_major_locator( ymajorLocator )
ax.yaxis.set_minor_locator( yminorLocator )
The default minor locator is the NullLocator, eg no minor ticks on by
default.
Tick formatting
---------------
Tick formatting is controlled by classes derived from Formatter. The
formatter operates on a single tick value and returns a string to the
axis.
* NullFormatter - no labels on the ticks
* FixedFormatter - set the strings manually for the labels
* FuncFormatter - user defined function sets the labels
* FormatStrFormatter - use a sprintf format string
* ScalarFormatter - default formatter for scalars; autopick the fmt string
* LogFormatter - formatter for log axes
You can derive your own formatter from the Formatter base class by
simply overriding the __call__ method. The formatter class has access
to the axis view and data limits.
To control the major and minor tick label formats, use one of the
following methods::
ax.xaxis.set_major_formatter( xmajorFormatter )
ax.xaxis.set_minor_formatter( xminorFormatter )
ax.yaxis.set_major_formatter( ymajorFormatter )
ax.yaxis.set_minor_formatter( yminorFormatter )
See examples/major_minor_demo1.py for an example of setting major an
minor ticks. See the matplotlib.dates module for more information and
examples of using date locators and formatters.
Classes |
| | |
- TickHelper
-
- Formatter
-
- FixedFormatter
- FormatStrFormatter
- FuncFormatter
- LogFormatter
-
- LogFormatterExponent
- LogFormatterMathtext
- NullFormatter
- ScalarFormatter
- Locator
-
- FixedLocator
- IndexLocator
- LinearLocator
- LogLocator
- MaxNLocator
-
- AutoLocator
- MultipleLocator
- NullLocator
class AutoLocator(MaxNLocator) |
| | |
- Method resolution order:
- AutoLocator
- MaxNLocator
- Locator
- TickHelper
Methods defined here:
- __init__(self)
Methods inherited from MaxNLocator:
- __call__(self)
- autoscale(self)
- bin_boundaries(self, vmin, vmax)
Methods inherited from Locator:
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class FixedFormatter(Formatter) |
| |
Return fixed strings for tick labels |
| |
- Method resolution order:
- FixedFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
- __init__(self, seq)
- seq is a sequence of strings. For positions i<len(seq) return
seq[i] regardless of x. Otherwise return ''
- get_offset(self)
- set_offset_string(self, ofs)
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- format_data(self, value)
- format_data_short(self, value)
- return a short string version
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class FixedLocator(Locator) |
| |
Tick locations are fixed. If nbins is not None,
the array of possible positions will be subsampled to
keep the number of ticks <= nbins +1. |
| |
- Method resolution order:
- FixedLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- Return the locations of the ticks
- __init__(self, locs, nbins=None)
Methods inherited from Locator:
- autoscale(self)
- autoscale the view limits
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class FormatStrFormatter(Formatter) |
| |
Use a format string to format the tick |
| |
- Method resolution order:
- FormatStrFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
- __init__(self, fmt)
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- format_data(self, value)
- format_data_short(self, value)
- return a short string version
- get_offset(self)
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class Formatter(TickHelper) |
| |
Convert the tick location to a string |
| |
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos; pos=None indicated unspecified
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- format_data(self, value)
- format_data_short(self, value)
- return a short string version
- get_offset(self)
- set_locs(self, locs)
Data and other attributes defined here:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class FuncFormatter(Formatter) |
| |
User defined function for formatting |
| |
- Method resolution order:
- FuncFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
- __init__(self, func)
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- format_data(self, value)
- format_data_short(self, value)
- return a short string version
- get_offset(self)
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class IndexLocator(Locator) |
| |
Place a tick on every multiple of some base number of points
plotted, eg on every 5th point. It is assumed that you are doing
index plotting; ie the axis is 0, len(data). This is mainly
useful for x ticks. |
| |
- Method resolution order:
- IndexLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- Return the locations of the ticks
- __init__(self, base, offset)
- place ticks on the i-th data points where (i-offset)%base==0
Methods inherited from Locator:
- autoscale(self)
- autoscale the view limits
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class LinearLocator(Locator) |
| |
Determine the tick locations
The first time this function is called it will try to set the
number of ticks to make a nice tick partitioning. Thereafter the
number of ticks will be fixed so that interactive navigation will
be nice |
| |
- Method resolution order:
- LinearLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- Return the locations of the ticks
- __init__(self, numticks=None, presets=None)
- Use presets to set locs based on lom. A dict mapping vmin, vmax->locs
- autoscale(self)
- Try to choose the view limits intelligently
Methods inherited from Locator:
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class Locator(TickHelper) |
| |
Determine the tick locations;
Note, you should not use the same locator between different Axis
because the locator stores references to the Axis data and view
limits |
| |
Methods defined here:
- __call__(self)
- Return the locations of the ticks
- autoscale(self)
- autoscale the view limits
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class LogFormatter(Formatter) |
| |
Format values for log axis;
if attribute decadeOnly is True, only the decades will be labelled. |
| |
- Method resolution order:
- LogFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
- __init__(self, base=10.0, labelOnlyBase=True)
- base is used to locate the decade tick,
which will be the only one to be labeled if labelOnlyBase
is False
- base(self, base)
- change the base for labeling - warning: should always match the base used for LogLocator
- format_data(self, value)
- format_data_short(self, value)
- return a short formatted string representation of a number
- is_decade(self, x)
- label_minor(self, labelOnlyBase)
- switch on/off minor ticks labeling
- nearest_long(self, x)
- pprint_val(self, x, d)
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- get_offset(self)
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class LogFormatterExponent(LogFormatter) |
| |
Format values for log axis; using exponent = log_base(value) |
| |
- Method resolution order:
- LogFormatterExponent
- LogFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
Methods inherited from LogFormatter:
- __init__(self, base=10.0, labelOnlyBase=True)
- base is used to locate the decade tick,
which will be the only one to be labeled if labelOnlyBase
is False
- base(self, base)
- change the base for labeling - warning: should always match the base used for LogLocator
- format_data(self, value)
- format_data_short(self, value)
- return a short formatted string representation of a number
- is_decade(self, x)
- label_minor(self, labelOnlyBase)
- switch on/off minor ticks labeling
- nearest_long(self, x)
- pprint_val(self, x, d)
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- get_offset(self)
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class LogFormatterMathtext(LogFormatter) |
| |
Format values for log axis; using exponent = log_base(value) |
| |
- Method resolution order:
- LogFormatterMathtext
- LogFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
Methods inherited from LogFormatter:
- __init__(self, base=10.0, labelOnlyBase=True)
- base is used to locate the decade tick,
which will be the only one to be labeled if labelOnlyBase
is False
- base(self, base)
- change the base for labeling - warning: should always match the base used for LogLocator
- format_data(self, value)
- format_data_short(self, value)
- return a short formatted string representation of a number
- is_decade(self, x)
- label_minor(self, labelOnlyBase)
- switch on/off minor ticks labeling
- nearest_long(self, x)
- pprint_val(self, x, d)
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- get_offset(self)
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class LogLocator(Locator) |
| |
Determine the tick locations for log axes |
| |
- Method resolution order:
- LogLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- Return the locations of the ticks
- __init__(self, base=10.0, subs=[1.0])
- place ticks on the location= base**i*subs[j]
- autoscale(self)
- Try to choose the view limits intelligently
- base(self, base)
- set the base of the log scaling (major tick every base**i, i interger)
- subs(self, subs)
- set the minor ticks the log scaling every base**i*subs[j]
Methods inherited from Locator:
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class MaxNLocator(Locator) |
| |
Select no more than N intervals at nice locations. |
| |
- Method resolution order:
- MaxNLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- __init__(self, nbins=10, steps=None, trim=True, integer=False, symmetric=False)
- autoscale(self)
- bin_boundaries(self, vmin, vmax)
Methods inherited from Locator:
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class MultipleLocator(Locator) |
| |
Set a tick on every integer that is multiple of base in the
viewInterval |
| |
- Method resolution order:
- MultipleLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- Return the locations of the ticks
- __init__(self, base=1.0)
- autoscale(self)
- Set the view limits to the nearest multiples of base that
contain the data
Methods inherited from Locator:
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class NullFormatter(Formatter) |
| |
Always return the empty string |
| |
- Method resolution order:
- NullFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
Methods inherited from Formatter:
- fix_minus(self, s)
- some classes may want to replace a hyphen for minus with the
proper unicode symbol as described here
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720.
The default is to do nothing
Note, if you use this method, eg in format_data or call, you
probably don't want to use it for format_data_short since the
toolbar uses this for interative coord reporting and I doubt
we can expect GUIs across platforms will handle the unicode
correctly. So for now the classes that override fix_minus
should have an explicit format_data_short method
- format_data(self, value)
- format_data_short(self, value)
- return a short string version
- get_offset(self)
- set_locs(self, locs)
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class NullLocator(Locator) |
| |
No ticks |
| |
- Method resolution order:
- NullLocator
- Locator
- TickHelper
Methods defined here:
- __call__(self)
- Return the locations of the ticks
Methods inherited from Locator:
- autoscale(self)
- autoscale the view limits
- pan(self, numsteps)
- Pan numticks (can be positive or negative)
- refresh(self)
- refresh internal information based on current lim
- zoom(self, direction)
- Zoom in/out on axis; if direction is >0 zoom in, else zoom out
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
class ScalarFormatter(Formatter) |
| |
Tick location is a plain old number. If useOffset==True and the data range
is much smaller than the data average, then an offset will be determined
such that the tick labels are meaningful. Scientific notation is used for
data < 1e-3 or data >= 1e4. |
| |
- Method resolution order:
- ScalarFormatter
- Formatter
- TickHelper
Methods defined here:
- __call__(self, x, pos=None)
- Return the format for tick val x at position pos
- __init__(self, useOffset=True, useMathText=False)
- fix_minus(self, s)
- use a unicode minus rather than hyphen
- format_data(self, value)
- return a formatted string representation of a number
- format_data_short(self, value)
- return a short formatted string representation of a number
- get_offset(self)
- Return scientific notation, plus offset
- pprint_val(self, x)
- set_locs(self, locs)
- set the locations of the ticks
- set_powerlimits(self, lims)
- Sets size thresholds for scientific notation.
e.g. xaxis.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 set_scientific().
- set_scientific(self, b)
- True or False to turn scientific notation on or off
see also set_powerlimits()
Data and other attributes inherited from Formatter:
- locs = []
Methods inherited from TickHelper:
- create_dummy_axis(self)
- set_axis(self, axis)
- set_bounds(self, vmin, vmax)
- set_data_interval(self, vmin, vmax)
- set_view_interval(self, vmin, vmax)
Data and other attributes inherited from TickHelper:
- DummyAxis = <class matplotlib.ticker.DummyAxis at 0xeaeef0>
- axis = None
|
|
Data |
| | |
__all__ = ('TickHelper', 'Formatter', 'FixedFormatter', 'NullFormatter', 'FuncFormatter', 'FormatStrFormatter', 'ScalarFormatter', 'LogFormatter', 'LogFormatterExponent', 'LogFormatterMathtext', 'Locator', 'IndexLocator', 'FixedLocator', 'NullLocator', 'LinearLocator', 'LogLocator', 'AutoLocator', 'MultipleLocator', 'MaxNLocator') |
|