From: David B. <db...@ya...> - 2004-04-01 23:50:02
|
It works great now. Thanks for the quick response and the fix John! Also to answer Todd Miller: >I googled around on this and got a suggestion having >to do with mainloop > handling from an old Guido e-mail. IDLE has a -n >switch ... In my initial message note the IDLE info: >IDLE 1.0 ==== No Subprocess ==== The 'No Subprocess' part indicates I'm using the -n flag. In IDLE 1.0, from my understanding, the IDE normally restarts the interpreter each time a program is run. The -n flag does not do this and runs everything together so the Tkinter mainloop does not get confused. It's not a great solution but it works and I have not had serious stability problems, at least for my limited needs. This trick is needed for the turtle module, and probably anything that uses Tkinter. And now back to trying matplotlib! -- David >>>>> "John" == John Hunter <jdhunter@ac...> writes: John> Ahh the golden piece of information. Todd Miller has John> reported that idle does not seem to respect matplotlibrc. John> At this point we have no idea why. We'll try to get this John> figured out ASAP! >>>> "John" == John Hunter <jdhunter@ac...> writes: > I found one problem. IDLE sets the HOME variable, >and there is a bug > in the way matplotlib located the rc file. >Basically, if HOME is set, > it expects the rc file to be there. Here is a fix. >Edit C:\Python23\Lib\site->packages\matplotlib\__init__.py and replace > the function matplotlib_fname with the following def matplotlib_fname(): 'Return the path to the rc file' if os.environ.has_key('MATPLOTLIBRC'): path = os.environ['MATPLOTLIBRC'] if os.path.exists(path): fname = os.path.join(path, '.matplotlibrc') if os.path.exists(fname): return fname if os.environ.has_key('HOME'): path = os.environ['HOME'] if os.path.exists(path): fname = os.path.join(path, '.matplotlibrc') if os.path.exists(fname): return fname path = get_data_path() # guaranteed to exist or raise fname = os.path.join(path, '.matplotlibrc') if not os.path.exists(fname): print >> sys.stderr, 'Could not find .matplotlibrc; using defaults' return fname > I tested this on windows with idle. Idle now >respects matplotlibrc > and loads TkAgg. However, at least on my system, >there is still some > idle bug because the Tk window launches and then >freezes without > displaying the figure I suspect Todd, the TkAgg >author, will be > looking at this soon. [Todd, I had this problem >with or without > window_focus set in my test]. >Sorry for the troubles, >JDH __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ |