I have a fairly large program that uses pylab and company. I want to use 
the matplot histogram function. Here are the declarations at the start. 
I added import matplotlib as mpl
---------------------start
from Tkinter import *
from numpy import *
import numpy
import pylab
import Image
import ImageChops
import ImageTk
import time
import binascii
import tkMessageBox
import tkSimpleDialog
from pylab import plot, xlabel, ylabel, title, show, xticks, bar
import matplotlib as mpl      <<<<---------- added

from tkFileDialog import asksaveasfilename
from tkFileDialog import askopenfilename

import MakeQTE

import socket

... 500 lines of code

     I've added the follow code in a function
        print "pltx_bins: ", pltx_bins
        print "Off to pylab: ", plt_bins[0:nplt_bins]
        fig = mpl.figure()
        v = array(plt_bins)
        print "v is: ",v
        print "edges --", linspace(0,256,nplt_bins+1)
        mpl.histogram(v, bins=linspace(0,256,nplt_bins+1), normed=1)# 
matplotlib version (plot)
        mpl.show()
        print "end of histogram output"
        # end of function
-------------------------end
The program dies at fig = figure() with:
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__
    return self.func(*args)
  File 
"C:\Sandia_Meteors\Sentinel_Development\Development_Sentuser+Utilities\sentuser\sentuser_20090103+hist.py",
 
line 504, in ShowHistogram
    fig = mpl.figure()
TypeError: 'module' object is not callable

What's the problem here?


-- 
           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