smpl.plot.FormatStrFormatter

class smpl.plot.FormatStrFormatter(fmt)[source]

Bases: Formatter

Use an old-style (‘%’ operator) format string to format the tick.

The format string should have a single variable format (%) in it. It will be applied to the value (not the position) of the tick.

Negative numeric values will use a dash, not a Unicode minus; use mathtext to get a Unicode minus by wrapping the format specifier with $ (e.g. “\(%g\)”).

__init__(fmt)[source]

Methods

__init__(fmt)

create_dummy_axis(**kwargs)

fix_minus(s)

Some classes may want to replace a hyphen for minus with the proper Unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via :rc:`axes.unicode_minus`.

format_data(value)

Return the full string representation of the value with the position unspecified.

format_data_short(value)

Return a short string version of the tick value.

format_ticks(values)

Return the tick labels for all the ticks at once.

get_offset()

set_axis(axis)

set_bounds(vmin, vmax)

[Deprecated]

set_data_interval(vmin, vmax)

[Deprecated]

set_locs(locs)

Set the locations of the ticks.

set_view_interval(vmin, vmax)

[Deprecated]

Attributes

axis

locs

static fix_minus(s)

Some classes may want to replace a hyphen for minus with the proper Unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via :rc:`axes.unicode_minus`.

format_data(value)

Return the full string representation of the value with the position unspecified.

format_data_short(value)

Return a short string version of the tick value.

Defaults to the position-independent long value.

format_ticks(values)

Return the tick labels for all the ticks at once.

set_bounds(vmin, vmax)

[Deprecated]

Notes

Deprecated since version 3.5: Use .Axis.set_view_interval and .Axis.set_data_interval instead.

set_data_interval(vmin, vmax)

[Deprecated]

Notes

Deprecated since version 3.5: Use .Axis.set_data_interval instead.

set_locs(locs)

Set the locations of the ticks.

This method is called before computing the tick labels because some formatters need to know all tick locations to do so.

set_view_interval(vmin, vmax)

[Deprecated]

Notes

Deprecated since version 3.5: Use .Axis.set_view_interval instead.