10
10
A = "horizontal" ,
11
11
B = "frame" ,
12
12
C = "cmap" ,
13
+ D = "annotate" ,
14
+ E = "barwidth" ,
15
+ F = "center" ,
13
16
G = "fill" ,
14
17
J = "projection" ,
18
+ L = "extreme" ,
19
+ N = "distribution" ,
20
+ Q = "cumulative" ,
15
21
R = "region" ,
22
+ S = "stairs" ,
16
23
T = "series" ,
24
+ U = "timestamp" ,
25
+ V = "verbose" ,
17
26
W = "pen" ,
27
+ X = "xshift" ,
28
+ Y = "yshift" ,
29
+ Z = "type" ,
18
30
c = "panel" ,
19
31
l = "label" ,
20
32
p = "perspective" ,
33
+ t = "transparency" ,
21
34
)
22
- @kwargs_to_strings (R = "sequence" , T = "sequence" )
35
+ @kwargs_to_strings (R = "sequence" , T = "sequence" , c = "sequence_comma" , p = "sequence" )
23
36
def histogram (self , table , ** kwargs ):
24
37
r"""
25
38
Plots a histogram, and can read data from a file or
@@ -40,16 +53,75 @@ def histogram(self, table, **kwargs):
40
53
{G}
41
54
{W}
42
55
{c}
43
- label : str
44
- Add a legend entry for the symbol or line being plotted.
45
- {p}
56
+ annotate : bool or str
57
+ [**+b**][**+f**\ *font*][**+o**\ *off*][**+r**].
58
+ Annotate each bar with the count it represents. Append any of the
59
+ following modifiers: Use **+b** to place the labels beneath the bars
60
+ instead of above; use **+f** to change to another font than the default
61
+ annotation font; use **+o** to change the offset between bar and
62
+ label [6p]; use **+r** to rotate the labels from horizontal to
63
+ vertical.
64
+ barwidth : int or float or str
65
+ *width*\ [**+o**\ *offset*].
66
+ Use an alternative histogram bar width than the default set via
67
+ ``series``, and optionally shift all bars by an *offset*. Here
68
+ *width* is either an alternative width in data units, or the user may
69
+ append a valid plot dimension unit (**c**\|\ **i**\|\ **p**) for a
70
+ fixed dimension instead. Optionally, all bins may be shifted along the
71
+ axis by *offset*. As for *width*, it may be given in data units of
72
+ plot dimension units by appending the relevant unit.
73
+ center : bool
74
+ Center bin on each value. [Default is left edge].
75
+ distribution : bool or int or float or str
76
+ [*mode*][**+p**\ *pen*].
77
+ Draw the equivalent normal distribution; append desired
78
+ *pen* [Default is 0.25p,black].
79
+ The *mode* selects which central location and scale to use:
80
+
81
+ * 0 = mean and standard deviation [Default];
82
+ * 1 = median and L1 scale (1.4826 \* median absolute deviation; MAD);
83
+ * 2 = LMS (least median of squares) mode and scale.
84
+ cumulative : bool or str
85
+ [**r**].
86
+ Draw a cumulative histogram by passing ``True``. Use **r** to display
87
+ a reverse cumulative histogram.
88
+ extreme : str
89
+ **l**\|\ **h**\|\ **b**.
90
+ The modifiers specify the handling of extreme values that fall outside
91
+ the range set by ``series``. By default these values are ignored.
92
+ Append **b** to let these values be included in the first or last
93
+ bins. To only include extreme values below first bin into the first
94
+ bin, use **l**, and to only include extreme values above the last bin
95
+ into that last bin, use **h**.
96
+ stairs : bool
97
+ Draws a stairs-step diagram which does not include the internal bars
98
+ of the default histogram.
46
99
horizontal : bool
47
100
Plot the histogram using horizonal bars instead of the
48
101
default vertical bars.
49
102
series : int or str or list
50
- [*min*\ /*max*\ /]\ *inc*\ [**+n**\ ]
103
+ [*min*\ /*max*\ /]\ *inc*\ [**+n**\ ].
51
104
Set the interval for the width of each bar in the histogram.
105
+ type : int or str
106
+ [*type*][**+w**].
107
+ Choose between 6 types of histograms:
52
108
109
+ * 0 = counts [Default]
110
+ * 1 = frequency_percent
111
+ * 2 = log (1.0 + count)
112
+ * 3 = log (1.0 + frequency_percent)
113
+ * 4 = log10 (1.0 + count)
114
+ * 5 = log10 (1.0 + frequency_percent).
115
+
116
+ To use weights provided as a second data column instead of pure counts,
117
+ append **+w**.
118
+ {XY}
119
+ {U}
120
+ {V}
121
+ label : str
122
+ Add a legend entry for the symbol or line being plotted.
123
+ {p}
124
+ {t}
53
125
"""
54
126
kwargs = self ._preprocess (** kwargs ) # pylint: disable=protected-access
55
127
with Session () as lib :
0 commit comments