c5ae3a8a16627132a551dd7bcf34e80d277cf2a2,plantcv/plot_hist.py,,plot_hist,#Any#Any#,7

Before Change


    xaxis = plt.xlim([0, (255)])
    fig_name = name + ".png"
    // write the figure to current directory
    plt.savefig(fig_name)
    // close pyplot plotting window
    plt.clf()

After Change


    from matplotlib import pyplot as plt

    // get histogram
    if img.dtype=="uint8":
        hist = cv2.calcHist([img], [0], None, [256], [0, 255])
        bins=range(0,256,1)

        if name!=False:
            // open pyplot plotting window using hist data
            plt.plot(hist)
            // set range of x-axis
            xaxis = plt.xlim([0, 255])
            fig_name = name + ".png"
            // write the figure to current directory
            plt.savefig(fig_name)
            // close pyplot plotting window
            plt.clf()

    else:
        hist, bins = np.histogram(img, bins="auto")

        if name!=False:
            // open pyplot plotting window using hist data
            plt.plot(bins[:-1],hist)
            plt.xticks(bins[:-1],rotation="vertical", fontsize=4)
            // set range of x-axis
            //xaxis = plt.xlim([0, bins.max()])
            fig_name = name + ".png"
            // write the figure to current directory
            plt.savefig(fig_name)
            // close pyplot plotting window
            plt.clf()

    return bins,hist
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: danforthcenter/plantcv
Commit Name: c5ae3a8a16627132a551dd7bcf34e80d277cf2a2
Time: 2016-11-22
Author: mgehan@danforthcenter.org
File Name: plantcv/plot_hist.py
Class Name:
Method Name: plot_hist


Project Name: arviz-devs/arviz
Commit Name: 78d2affb6deac27c92a6bfca29d0c8371b5eb52b
Time: 2019-12-09
Author: oriol.abril.pla@gmail.com
File Name: doc/sphinxext/gallery_generator.py
Class Name: ExampleGenerator
Method Name: exec_file


Project Name: danforthcenter/plantcv
Commit Name: 4bd9e98e3a538f9ef3676db3f2f3947de138e256
Time: 2017-02-20
Author: maxjfeldman@gmail.com
File Name: plantcv/plot_hist.py
Class Name:
Method Name: plot_hist