Hi,

> I'm currently using the hist plot from matlibplot. Here I have the  
> following
> question: is there an easy way to set the bin content of a  
> specified bin?
> For example, I would like to call set_bin_content(bin_index=1,  
> value=10000)
> once instead of filling in 10000 times the same value.


You can do this by separating the histogram calculation from the  
plotting.

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

# generate data here; for example
data = np.random.randn(500)

myHist, myBinEdges = np.histogram(data)

# edit myHist to your heart's delight

wid = myBinEdges[1:] - myBinEdges[:-1]
plt.bar(myBinEdges[:-1], myHist, width=wid)
plt.show()

-Jeff


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to