Plot the histogram with matplotlib, returns `matplotlib` figure.
973747
def plot(self, ax=None, **kwargs):
        
        ax, fig, plt = get_ax_fig_plt(ax)

        yy = [len(v) for v in self.values]
        ax.plot(self.binvals, yy, **kwargs)

        return fig
1245357
def plot(self, bins=250, **kwargs):
        """"""
        # Data #
        counts = [sum(map(len, b.contigs)) for b in self.parent.bins]
        # Linear bins in logarithmic space #
        if 'log' in kwargs.get('x_scale', ''):
            start, stop = numpy.log10(1), numpy.log10(max(counts))
            bins = list(numpy.logspace(start=start, stop=stop, num=bins))
            bins.insert(0, 0)
        # Plot #
        fig = pyplot.figure()
        pyplot.hist(counts, bins=bins, color='gray')
        axes = pyplot.gca()
        # Information #
        title = 'Distribution of the total nucleotide count in the bins'
        axes.set_title(title)
        axes.set_xlabel('Number of nucleotides in a bin')
        axes.set_ylabel('Number of bins with that many nucleotides in them')
        # Save it #
        self.save_plot(fig, axes, **kwargs)
        pyplot.close(fig)
        # For convenience #
        return self
1313846
def plot(self, key=None, invert=None, plotmethod='imshow',
             cmap=plt.cm.gray, ms=4, Max=None,
             fs=None, dmargin=None, wintit=None,
             draw=True, connect=True):
        
        dax, KH = _plot.Data_plot(self, key=key, invert=invert, Max=Max,
                                  plotmethod=plotmethod, cmap=cmap, ms=ms,
                                  fs=fs, dmargin=dmargin, wintit=wintit,
                                  draw=draw, connect=connect)
        return dax, KH
186501
def show(self):
        """"""
        with_matplotlib = True
        try:
            import matplotlib.pyplot as plt
        except RuntimeError:
            import skimage.io as io
            with_matplotlib = False
            
        if with_matplotlib:
            equalised_img = self.equalise()
            
            _, ax = plt.subplots()
            
            ax.imshow(equalised_img, cmap='gray')
    
            import random
            
            for contour_set in self.as_contours.itervalues():
                r, g, b = random.random(), random.random(), random.random()
                [ax.plot(contour[:,1], contour[:,0], linewidth=2, color=(r,g,b,1)) for contour in contour_set]
            
            ax.axis('image')
            ax.set_xticks([])
            ax.set_yticks([])
            
            plt.show()
        else:
            io.imshow(self.equalise())
            io.show()
603499
def plot(self, minx=-1.5, maxx=1.2, miny=-0.2, maxy=2, **kwargs):
        
        import matplotlib.pyplot as pp
        grid_width = max(maxx-minx, maxy-miny) / 200.0

        ax = kwargs.pop('ax', None)

        xx, yy = np.mgrid[minx:maxx:grid_width, miny:maxy:grid_width]
        V = self.potential(xx, yy)
        # clip off any values greater than 200, since they mess up
        # the color scheme
        if ax is None:
            ax = pp

        ax.contourf(xx, yy, V.clip(max=200), 40, **kwargs)
1223153
def draw_histogram():
    

    mu, sigma = 100, 15
    x = mu + sigma * numpy.random.randn(10000)
    fig = pyplot.figure()
    ax = fig.add_subplot(111)
    n, bins, patches = ax.hist(x, 50, normed=1, facecolor='green', alpha=0.75)

    ax.set_xlabel('Random number generated')
    ax.set_ylabel('Probability')
    ax.set_xlim(40, 160)
    ax.set_ylim(0, 0.03)
    ax.grid(True)

    pyplot.savefig(histogram_filename)
1170373
def histogram(self, column='r', filename=None, log10=False, **kwargs):
        """"""
        return_dict = HS.plot_histograms(self.data, column)
        if filename is not None:
            return_dict['all'].savefig(filename, dpi=300)
        return return_dict
76643
def heatmap(x, y, step=None, min_pt=None, max_pt=None,
                 colormap='Blues', alpha=1, grid=False,
                 colorbar=True, scale='lin',
                 vmax='auto', vmin='auto', crop=True):
    
    (x_vec, y_vec, hist_matrix) = calc_2d_hist(x, y, step, min_pt, max_pt)

    # simple in this case because it is positive counts
    if scale == 'log':
        for row in hist_matrix:
            for i, el in enumerate(row):
                row[i] = 0 if row[i] == 0 else log10(row[i])

    # plot
    fig = plt.figure()
    init_heatmap(x_vec, y_vec, hist_matrix, fig, colormap=colormap,
                 alpha=alpha, grid=grid, colorbar=colorbar,
                 vmax=vmax, vmin=vmin, crop=crop)

    return fig
22421
def show(self, *args, **kwargs):
        
        plt = self.get_pourbaix_plot(*args, **kwargs)
        plt.show()
166941
def plot(self):
        
        # The PyTables node tied to the current leaf of the databases tree
        current = self.vtgui.dbs_tree_view.currentIndex()
        leaf = self.vtgui.dbs_tree_model.nodeFromIndex(current).node

        data_name = leaf.name

        hists_1d = ['HistRelBcid', 'HistErrorCounter', 'HistTriggerErrorCounter', 'HistServiceRecord', 'HistTot', 'HistTdc', 'HistClusterTot', 'HistClusterSize']
        hists_2d = ['HistOcc', 'Enable', 'Imon', 'C_High', 'EnableDigInj', 'C_Low', 'FDAC', 'TDAC', 'HistTdcPixel', 'HistTotPixel', 'HistThreshold', 'HistNoise', 'HistThresholdFitted', 'HistNoiseFitted', 'HistThresholdFittedCalib', 'HistNoiseFittedCalib']

        if data_name in hists_1d:
            plot_1d_hist(hist=leaf[:], title=data_name)
        elif data_name in hists_2d:
            if data_name == 'HistOcc':
                leaf = np.sum(leaf[:], axis=2)
            plot_2d_hist(hist=leaf[:], title=data_name)
        elif 'Table' in str(type(leaf)) and len(leaf[:].dtype.names) <= 3:  # detect tables with less than 4 columns
            plot_table(leaf[:], title=data_name)
        elif data_name == 'HitOrCalibration':
            print 'Comming soon'
        else:
            print 'Plotting', data_name, '(%s) is not supported!' % type(leaf)
1059437
def numpy_histogram(a, bins=10, range=None, normed=False, weights=None):
    ''''''
    args = inspect.getargs(np.histogram.__code__)[0]
    if args[-1] == "new":
        return np.histogram(a, bins, range, normed, weights, new=True)
    return np.histogram(a, bins, range, normed, weights)
391365
def plot(self):
        
        seaborn.pointplot(
            y = self.pointwise.pareto_k,
            x = self.pointwise.index,
            join = False)
657361
def plot(self, x, y, **kw):
        
        self.panel.plot(x, y, **kw)
435431
def plot(self, numPoints=100):
    
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')

    for feature in self._FEATURES:

      for _ in xrange(numPoints):
        x, y, z = tuple(self.sampleLocationFromFeature(feature))
        ax.scatter(x, y, z, marker=".")

    ax.set_xlabel('X')
    ax.set_ylabel('Y')
    ax.set_zlabel('Z')

    plt.title("{}".format(self))
    return fig, ax
998460
def plot(self, figsize=None, ax=None, **kwargs):
        '''
        
        '''
        if ax is None:
            fig, ax = plt.subplots(figsize=figsize)
        ax.set_aspect('equal')
        ax.matshow(self.raster, **kwargs)
        plt.draw()
        return ax
57547
def draw_plot(self):
        
        import numpy, pylab
        state = self.state

        if len(self.data[0]) == 0:
            print("no data to plot")
            return
        vhigh = max(self.data[0])
        vlow  = min(self.data[0])

        for i in range(1,len(self.plot_data)):
            vhigh = max(vhigh, max(self.data[i]))
            vlow  = min(vlow,  min(self.data[i]))
        ymin = vlow  - 0.05*(vhigh-vlow)
        ymax = vhigh + 0.05*(vhigh-vlow)

        if ymin == ymax:
            ymax = ymin + 0.1
            ymin = ymin - 0.1
        self.axes.set_ybound(lower=ymin, upper=ymax)
        self.axes.grid(True, color='gray')
        pylab.setp(self.axes.get_xticklabels(), visible=True)
        pylab.setp(self.axes.get_legend().get_texts(), fontsize='small')

        for i in range(len(self.plot_data)):
            ydata = numpy.array(self.data[i])
            xdata = self.xdata
            if len(ydata) < len(self.xdata):
                xdata = xdata[-len(ydata):]
            self.plot_data[i].set_xdata(xdata)
            self.plot_data[i].set_ydata(ydata)

        self.canvas.draw()
791936
def plot(histogram: HistogramBase, kind: Optional[str] = None, backend: Optional[str] = None, **kwargs):
    
    backend_name, backend = _get_backend(backend)
    if kind is None:
        kinds = [t for t in backend.types if histogram.ndim in backend.dims[t]]
        if not kinds:
            raise RuntimeError("No plot type is supported for {0}"
                               .format(histogram.__class__.__name__))
        kind = kinds[0]
    if kind in backend.types:
        method = getattr(backend, kind)
        return method(histogram, **kwargs)
    else:
        raise RuntimeError("Histogram type error: {0} missing in backend {1}"
                           .format(kind, backend_name))