PRBPlotStyle¶
- class Stoner.plot.formats.PRBPlotStyle(*args, **kargs)[source]¶
Bases:
DefaultPlotStyle
A figure Style for making figures for Phys Rev * Jounrals.
Example
"""Example plot using a style similar to Physical Review B.""" import os.path as path from Stoner import Data, __home__ from Stoner.plot.formats import PRBPlotStyle filename = path.realpath( path.join(__home__, "..", "doc", "samples", "sample.txt") ) d = Data(filename, setas="xy", template=PRBPlotStyle) d.plot()
Attributes Summary
Horribly hacky method to traverse over the class hierarchy for style sheet names.
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.
Implement hook to customise plot.
customise_axes
(ax, plot)Override the default axis configuration.
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 = 'PRB'¶
- 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
- 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.
- 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 ¶