@@ -20,26 +20,26 @@ class PlotStyle(dict):
20
20
This style class is used by :class:`BasePlotter` and :class:`BaseDrawer`. The default style for
21
21
Qiskit Experiments is defined in :meth:`default_style`. Style parameters are stored as dictionary
22
22
entries, grouped by graphics or figure component. For example, style parameters relating to textboxes
23
- have the prefix ``textbox. ``. For default style parameter names and their values, see the
23
+ have the prefix ``textbox_ ``. For default style parameter names and their values, see the
24
24
:meth:`default_style` method.
25
25
26
26
Example:
27
27
.. code-block:: python
28
28
# Create custom style
29
29
custom_style = PlotStyle(
30
30
{
31
- "legend.loc ": "upper right",
32
- "textbox.rel_pos ": (1, 1),
33
- "textbox.text_size ": 14,
31
+ "legend_loc ": "upper right",
32
+ "textbox_rel_pos ": (1, 1),
33
+ "textbox_text_size ": 14,
34
34
}
35
35
)
36
36
37
37
# Create full style, using PEP448 to combine with default style.
38
38
full_style = PlotStyle.merge(PlotStyle.default_style(), custom_style)
39
39
40
40
# Query style parameters
41
- full_style["legend.loc "] # Returns "upper right"
42
- full_style["axis.label_size "] # Returns the value provided in ``PlotStyle.default_style()``
41
+ full_style["legend_loc "] # Returns "upper right"
42
+ full_style["axis_label_size "] # Returns the value provided in ``PlotStyle.default_style()``
43
43
"""
44
44
45
45
@classmethod
@@ -48,12 +48,12 @@ def default_style(cls) -> "PlotStyle":
48
48
49
49
Style Parameters:
50
50
figsize (Tuple[int,int]): The size of the figure ``(width, height)``, in inches.
51
- legend.loc (str): The location of the legend.
52
- tick.label_size (int): The font size for tick labels.
53
- axis.label_size (int): The font size for axis labels.
54
- textbox.rel_pos (Tuple[float,float]): The relative position ``(horizontal, vertical)`` of
51
+ legend_loc (str): The location of the legend.
52
+ tick_label_size (int): The font size for tick labels.
53
+ axis_label_size (int): The font size for axis labels.
54
+ textbox_rel_pos (Tuple[float,float]): The relative position ``(horizontal, vertical)`` of
55
55
textboxes, as a percentage of the canvas dimensions.
56
- textbox.text_size (int): The font size for textboxes.
56
+ textbox_text_size (int): The font size for textboxes.
57
57
58
58
Returns:
59
59
PlotStyle: The default plot style used by Qiskit Experiments.
@@ -62,15 +62,15 @@ def default_style(cls) -> "PlotStyle":
62
62
# size of figure (width, height)
63
63
"figsize" : (8 , 5 ), # Tuple[int, int]
64
64
# legend location (vertical, horizontal)
65
- "legend.loc " : "center right" , # str
65
+ "legend_loc " : "center right" , # str
66
66
# size of tick label
67
- "tick.label_size " : 14 , # int
67
+ "tick_label_size " : 14 , # int
68
68
# size of axis label
69
- "axis.label_size " : 16 , # int
69
+ "axis_label_size " : 16 , # int
70
70
# relative position of a textbox
71
- "textbox.rel_pos " : (0.6 , 0.95 ), # Tuple[float, float]
71
+ "textbox_rel_pos " : (0.6 , 0.95 ), # Tuple[float, float]
72
72
# size of textbox text
73
- "textbox.text_size " : 14 , # int
73
+ "textbox_text_size " : 14 , # int
74
74
}
75
75
return cls (** style )
76
76
0 commit comments