Question: Define a function, plot _ temperature _ histogram ( Ts , bins, range ) , which produces a histogram ( as a matplotlib figure )

Define a function, plot_temperature_histogram(Ts, bins, range), which produces a histogram (as a matplotlib figure) showing the temperatures encountered at the end of the random walks grouped into counts based on bins of temperature ranges. The parameter Ts is a numpy array of temperatures from all individual walks; it is part of the output from a call to wos_temperature_estimate. The
parameter bins is an integer which indicates how many bins are used in the histogram, and range is a tuple with two floats of form (T_min, T_max) where Tmin is the lower temperature bound for the histogram and Tmax is the upper bound. As a hint, take a look at the matplotlib documentation for producing histograms.
sample
>>> x =0.6; y =0.3
>>> length =1.0; epsilon =0.01
>>> cnr_temps ={'sw':600.0,'se':700.0,'ne':1000.0,'nw':850.0}
>>> number_walks =100
>>> random.seed(1)
>>>(T_avg, Ts)= wos_temperature_estimate(x, y, length, cnr_temps, epsilon,
,-> number_walks)
>>> plot_temperature_histogram(Ts,8,(600.0,1000.0))
 Define a function, plot_temperature_histogram(Ts, bins, range), which produces a histogram (as

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!