MCPcopy Create free account
hub / github.com/vispy/vispy / histogram

Method histogram

vispy/plot/plotwidget.py:165–188  ·  view source on GitHub ↗

Calculate and show a histogram of data Parameters ---------- data : array-like Data to histogram. Currently only 1D data is supported. bins : int | array-like Number of bins, or bin edges. color : instance of Color Color of

(self, data, bins=10, color='w', orientation='h')

Source from the content-addressed store, hash-verified

163 self._configured = True
164
165 def histogram(self, data, bins=10, color='w', orientation='h'):
166 """Calculate and show a histogram of data
167
168 Parameters
169 ----------
170 data : array-like
171 Data to histogram. Currently only 1D data is supported.
172 bins : int | array-like
173 Number of bins, or bin edges.
174 color : instance of Color
175 Color of the histogram.
176 orientation : {'h', 'v'}
177 Orientation of the histogram.
178
179 Returns
180 -------
181 hist : instance of Polygon
182 The histogram polygon.
183 """
184 self._configure_2d()
185 hist = scene.Histogram(data, bins, color, orientation)
186 self.view.add(hist)
187 self.view.camera.set_range()
188 return hist
189
190 def image(self, data, cmap='cubehelix', clim='auto', fg_color=None, **kwargs):
191 """Show an image

Callers 2

__init__Method · 0.80

Calls 3

_configure_2dMethod · 0.95
set_rangeMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected