On 16.04.2013 14:58, Pierre Haessig wrote:
> Hi,
>
> Le 16/04/2013 12:14, Detlef Maurel (IKP) a écrit :
>> there seems to be a bug in in pyplot.hist when using histtype="step".
>>
>> I am plotting the attached data to a histogram (see 1.png). In this
>> case I set the limits on the y axis manually.
>>
>> When I don't do this (let the hist function choose the limits), I get
>> the picture in the file 2.png. Only the highest bin is drawn. To be
>> exact, ymin=second highest value, ymax=highest value.
> Can you also send a minimal code that reproduces the bug. I just tried a
> hist(x, histtype='step') command, with x being a random vector and it
> works fine.
>
this works for me, too. Strange... I get the problem with the attached
dataset using the command
hist(loadtxt("data.txt"),bins=300,histtype="step")
When I plot only a subset of the data (first/second/third/... thousand
numbers),
the histogram looks fine. It seems it gets wrong when more than roughly
2000 numbers are used.
I will try to dig more into this and let you know if I find something.
cheers
Detlef
|