Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
PlotStyle¶
- class PlotStyle[source]¶
A stylesheet for
BasePlotter
andBaseDrawer
.This style class is used by
BasePlotter
andBaseDrawer
. The default style for Qiskit Experiments is defined indefault_style()
. Style parameters are stored as dictionary entries, grouped by graphics or figure component. For example, style parameters relating to textboxes have the prefixtextbox_
. For default style parameter names and their values, see thedefault_style()
method.Example
# Create custom style custom_style = PlotStyle( { "legend_loc": "upper right", "textbox_rel_pos": (1, 1), "textbox_text_size": 14, } ) # Create full style instance by combining with default style. full_style = PlotStyle.merge(PlotStyle.default_style(), custom_style) ## Query style parameters # Returns "upper right" full_style["legend_loc"] # Returns the value provided in ``PlotStyle.default_style()`` full_style["axis_label_size"]
Methods
x.__getitem__(y) <==> x[y]
Return len(self).
The default style across Qiskit Experiments.
PlotStyle.fromkeys
([value])Create a new dictionary with keys from iterable and values set to value.
PlotStyle.get
(key[, default])Return the value for key if key is in the dictionary, else default.
PlotStyle.merge
(style1, style2)Merge
style2
intostyle1
as a new PlotStyle instance.PlotStyle.pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised
Remove and return a (key, value) pair as a 2-tuple.
PlotStyle.setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
PlotStyle.update
([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
Return len(self).
x.__getitem__(y) <==> x[y]