Random Data Histogram Generation

  • Share this:

Code introduction


This function creates a histogram of random data to show the distribution of the data.


Technology Stack : Bokeh

Code Type : Data visualization

Code Difficulty : Intermediate


                
                    
def random_histogram(data):
    from bokeh.plotting import figure, show
    from bokeh.charts import Histogram
    
    p = figure(title="Random Histogram", tools="save,pan,wheel_zoom,box_zoom,reset")
    h = Histogram(data, title="Data Distribution", group_by=None, bin_size=1, width=500, height=300)
    p.add_layout(h, 'right')
    show(p)                
              
Tags: