Hi, this is an odd result. I copied your code and tried to execute it
with Python 2.5. It came back with a socket area, and a reference to my
firewall. Very strange. Ah, I happen to have a comm port open to another
computer. Apparently Python didn't like that.

Anyway, where, folder, does your program write the files? I'm not
familiar with figure, but apparently using it produces some "canvas"
that plt.hist places it's output on. One can than save fig to a file.
What happens if I don't use figure? I just put a copy of the line
plt.hist([1, 2, 3, 4, 5], range=(0, 20)) after import. When I execute
the program, I don't see a graphic appear. So doesn't matplotlib produce
graphic output aside from use of figure?

I think I've confused hist as part of numpy and histogram as part of
matplotlib. A visit to the numpy and matplotlib web sites shows I am
confused.

Let's see. I want to know how to use a histogram in Python, so there is
a histogram function and a hist. So a histogram is for histograms. What
fun word play. :-) Maybe numpy should have called their function ahistogram!


Johan Grönqvist wrote:
> Wayne Watson skrev:
>   
>> See Subject. I don't seem able to produce a simple example of using 
>> histogram that uses range. I tried a variety of ranges, range=(0,22), 
>> range=(0, 50.2), ... and I see no difference between any of the x values 
>> scale. Can someone provide an example that shows how it works?
>>
>>     
>
> The script below works for me. It produces two files with different 
> limits on the x-axis and corresponding histograms.
>
>
> ------------
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> plt.hist([1, 2, 3, 4, 5], range=(0, 20))
> plt.savefig("hist_0_20.png")
> plt.close(fig)
>
> fig = plt.figure()
> plt.hist([1, 2, 3, 4, 5], range=(0, 8))
> plt.savefig("hist_0_8.png")
> plt.close(fig)
> -------------
>
> Hope it helps
>
> / johan
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   

-- 
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

                   350 350 350 350 350 350 350 350 350 350
                     Make the number famous. See 350.org
            The major event has passed, but keep the number alive.

                    Web Page: <www.speckledwithstars.net/>



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to