JTBPlotStyle

class Stoner.plot.formats.JTBPlotStyle(*args, **kargs)[source]

Bases: DefaultPlotStyle

Template class for Joe’s Plot settings.

Example

"""Example plot using Joe Batley's plot style."""
import os.path as path

from Stoner import Data, __home__
from Stoner.plot.formats import JTBPlotStyle

filename = path.realpath(
    path.join(__home__, "..", "doc", "samples", "sample.txt")
)
d = Data(filename, setas="xy", template=JTBPlotStyle)
d.plot()

(png, hires.png, pdf)

../_images/jtbstyle.png

Attributes Summary

show_legend

show_title

show_xlabel

show_ylabel

show_zlabel

stylename

stylesheet

Horribly hacky method to traverse over the class hierarchy for style sheet names.

subplot_settings

Methods Summary

__call__(**kargs)

Call the template object can manipulate the rcParams that will be set.

annotate(ix, multiple, plot, **kargs)

Call all the routines necessary to annotate the axes etc.

apply()

Update matplotlib rc parameters from any attributes starting template_.

clear()

Reset everything back o defaults.

customise()

Implement hook to customise plot.

customise_axes(ax, plot)

Override the default axis configuration (or not).

get(k[,d])

items()

keys()

new_figure([figure])

Create a new figure.

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[,d])

update(*args, **kargs)

Update the template with new attributes from keyword arguments.

values()

Attributes Documentation

show_legend = True
show_title = False
show_xlabel = True
show_ylabel = True
show_zlabel = True
stylename = 'JTB'
stylesheet

Horribly hacky method to traverse over the class hierarchy for style sheet names.

subplot_settings = {'panels': {'title': (True, False, False), 'xlabel': (False, False, True), 'ylabel': (True, True, True), 'zlabel': (False, False, False)}, 'subplots': {'title': (True, True, True), 'xlabel': (True, True, True), 'ylabel': (True, True, True), 'zlabel': (False, False, False)}, 'y2': {'title': (True, False, False), 'xlabel': (True, False, False), 'ylabel': (True, True, True), 'zlabel': (False, False, False)}}

Methods Documentation

__call__(**kargs)

Call the template object can manipulate the rcParams that will be set.

annotate(ix, multiple, plot, **kargs)

Call all the routines necessary to annotate the axes etc.

Parameters:
  • ix (integer) – Index of current subplot

  • multiple (string) – how to handle multiple subplots

  • plot (Stoner.plot.PlotMixin) – The PlotMixin boject we’re working with

apply()

Update matplotlib rc parameters from any attributes starting template_.

clear()

Reset everything back o defaults.

customise()

Implement hook to customise plot.

This method is supplied for sub classes to override to provide additional plot customisation after the rc parameters are updated from the class and instance attributes.

customise_axes(ax, plot)[source]

Override the default axis configuration (or not).

get(k[, d]) D[k] if k in D, else d.  d defaults to None.
items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
new_figure(figure=False, **kargs)

Create a new figure.

This is called by PlotMixin to setup a new figure before we do anything.

pop(k[, d]) v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D
update(*args, **kargs)

Update the template with new attributes from keyword arguments.

Up to one positional argument may be supplied

Keyword arguments may be supplied to set default parameters. Any Matplotlib rc parameter may be specified, with .’s replaced with _ and )_ replaced with __.

values() an object providing a view on D's values