Re: [Matplotlib-users] ANN: matplotlib-0.90.0
Russell E Owen wrote: > I did earlier today; I'm hoping it will go up in the next day or so. > > WXAgg is built against wxPython 2.6.x because last I heard the 2.8.x > issues weren't resolved. Correct. I'm still not sure how well MPL works with wxPython2.8 on other platforms, but no one has fixed the issues on OS-X yet. There is something weird with toolbars with wxPython2.8, I've run into that with some other code, so it may even take a new release of wxPython to get it all right. Of course, that wont' do it if I dont' get around to fiing a bug report! wxPython includes a wxversion module that lets one select whihc version of wxPython you want run, if more than one is installed. It might be nice if those calls could get put into MPL somewhere, so that when MPL is built against a given version, that version will be run. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [matplotlib-devel] Unifying numpy, scipy, and matplotlib docstring formats
There's probably a better forum for this conversation, but... Barry Wark wrote: > Perhaps we should consider two use cases: interactive use ala Matlab > and larger code bases. A couple key points -- yes, interactive use is different than larger code bases, but I think it's a "Bad Idea" to promite totally different coding styles for these cases for a couple reasons: -- One usually is doing both at once. I was a long-time, every day Matlab user, and hardly did anything of consequence interactively. I learned very quickly that it made a whole lot more sense to write a five line script that I could save, edit, etc. than do stuff interactively. Once I got something working, parts of that five line script might get cut&pasted into "real" code. I do still test one or two lines interactively, but even then, I want the style to be something I can put in my code. 2) consistency in docs and examples is important, recommending different styles for interactive and programming use is just going to confuse people more. 3) even for folks that do a lot of interactive use, they are likely to write larger scale code at some point, and then they would need to learn something new. > In the first case, being able to import * saves > a lot of typing No, it saves a little typing, if you're using an OOO style anyway. > and the namespace polution problem isn't a big deal. Yes, it can be. A good interactive environment will be able to do things like method and command completion -- namespace pollution keeps that from working well. > Returning to the OP's questions, why couldn't both cases be helped by > creating a "meta-package" for numpy, scipy, and matplotlib? For the > sake of argument, lets call the package "plab". Existing code could be > affected by changing the individual packages, but a package that > essentially does > > from pylab import * > from numpy import * > from scipy import * The issue with this is that you've now hidden where things are coming from. People seeing examples using that package will have no idea where things come from. and by the way, the current "pylab", as delivered with MPL, pretty much does this already. I think we need to move away from that, rather than putting even more into pylab. Matthew Brett wrote: > The downside about making numpy / python like matlab is that > you soon realize that you really have to think about your problems > differently, and write code in a different way. Good point. A part of good Pythonic code is namespaces and OOO style. New users might as well learn the whole pile at once. That all being said, it would be nice to establish a standard convention for how to import the key packages. I use: import numpy as N import matplotlib as MPL But I don't really care that much, if we can come to any kind of community consensus, I'll follow it. The goal would be for all docs, Wiki entries, examples on the mailing lists, etc. to use the same style. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] "cannot import name rcParams"
I have a strange problem with my builds of matplotlib on OS X 10.4: If I install them from the command line, with setup.py, they install fine and matplotlib can be imported with no problem. However, I need to build distributable OS X packages, which I do using bdist_mpkg; when this package is installed, I get an error when importing pylab: from pylab import * Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pylab.py", line 1, in from matplotlib.pylab import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/pylab.py", line 199, in import cm File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/cm.py", line 5, in import colors File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/colors.py", line 38, in from numerix import array, arange, take, put, Float, Int, putmask, \ File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/numerix/__init__.py", line 20, in from matplotlib import rcParams, verbose ImportError: cannot import name rcParams I would appreciate any help to resolve this issue. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] "cannot import name rcParams"
I have a strange problem with my builds of matplotlib on OS X 10.4: If I install them from the command line, with setup.py, they install fine and matplotlib can be imported with no problem. However, I need to build distributable OS X packages, which I do using bdist_mpkg; when this package is installed, I get an error when importing pylab: from pylab import * Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib /python2.5/site-packages/pylab.py", line 1, in from matplotlib.pylab import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib /python2.5/site-packages/matplotlib/pylab.py", line 199, in import cm File "/Library/Frameworks/Python.framework/Versions/2.5/lib /python2.5/site-packages/matplotlib/cm.py", line 5, in import colors File "/Library/Frameworks/Python.framework/Versions/2.5/lib /python2.5/site-packages/matplotlib/colors.py", line 38, in from numerix import array, arange, take, put, Float, Int, putmask, \ File "/Library/Frameworks/Python.framework/Versions/2.5/lib /python2.5/site-packages/matplotlib/numerix/__init__.py", line 20, in from matplotlib import rcParams, verbose ImportError: cannot import name rcParams I would appreciate any help to resolve this issue. -- Christopher J. Fonnesbeck Population Ecologist, Marine Mammal Section Fish & Wildlife Research Institute (FWC) St. Petersburg, FL Adjunct Assistant Professor Warnell School of Forestry and Natural Resources University of Georgia Athens, GA T: 727.235.5570 E: Chris dot Fonnesbeck at MyFWC dot com - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Bus error on multiple hist plots
I get a repeatable bus error when trying to plot more than one histogram of simulated data. The first plot is generated without error, but invariably a second plot crashes: In [4]: x = random.negative_binomial(2, 0.25, 1000) In [5]: from pylab import * In [6]: hist(x) Out[6]: (array([240, 318, 206, 102, 65, 38, 17, 5, 6, 3]), array([ 0., 3., 6., 9., 12., 15., 18., 21., 24., 27.]), ) In [7]: show() In [8]: x = random.negative_binomial(2, 0.5, 1000) In [9]: hist(x) Bus error This is using recent svn builds of numpy and maplotlib. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] pytz, dateutil not getting installed from svn build
For some reason, builds from SVN dont install either pytz or dateutil (at least not in the right place). Importing pylab from these builds results in an import error. How can I build these so as to convince these modules to install correctly? Thanks. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Error in OSX
Hello All, When I launch ipython (by typing "ipython -pylab") and issue the first matplotlib command, such as simply "figure()", I get the following error messages: TkMacOSXDoHLEvent failed : cppe 1 ,kHighLevelEvent 44464458 XDFD,-1708 TkMacOSXDoHLEvent failed : cppe 1 ,kHighLevelEvent 44464458 XDFD,-1708 Any subsequent calls yield no problems. While this is not a show stopper, it is certainly annoying. Any thoughts on what might be causing the problem? Thanks in advance for your assistance! Chris - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] hist() hangs on OSX 10.5
Running a recent build from svn on OSX 10.5, the TkAgg interface becomes unresponsive after plotting a histogram and calling show(). Here is a sample from the process, in case it is useful: Sampling process 5635 for 3 seconds with 1 millisecond of run time between samples Sampling completed, processing symbols... Analysis of sampling Python (pid 5635) every 1 millisecond Call graph: 2496 Thread_2503 2496 0x1f84 2496 Py_Main 2496 PyRun_SimpleFileExFlags 2496 PyRun_FileExFlags 2496 PyErr_Display 2496 PyEval_EvalCode 2496 PyEval_EvalCodeEx 2496 PyEval_EvalFrameEx 2496 PyEval_EvalCodeEx 2496 PyEval_EvalFrameEx 2496 PyEval_EvalCodeEx 2496 PyEval_EvalFrameEx 2496 PyEval_EvalCodeEx 2496 PyEval_EvalFrameEx 2496 PyEval_EvalCodeEx 2496 PyEval_EvalFrameEx 2496 PyAST_FromNode 2496 PyOS_Readline 2496 0x4521e0 2496 select$DARWIN_EXTSN 2496 select$DARWIN_EXTSN Total number in stack (recursive counted multiple, when >=5): 5 PyEval_EvalCodeEx 5 PyEval_EvalFrameEx Sort by top of stack, same collapsed (when >= 5): select$DARWIN_EXTSN2496 Sample analysis of process 5635 written to file /dev/stdout - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] hist() hangs on OSX 10.5
On Dec 2, 2007 10:44 PM, John Hunter <[EMAIL PROTECTED]> wrote: > On Dec 2, 2007 9:23 PM, Chris Fonnesbeck <[EMAIL PROTECTED]> wrote: > > Running a recent build from svn on OSX 10.5, the TkAgg interface > > becomes unresponsive after plotting a histogram and calling show(). > > Here is a sample from the process, in case it is useful: > > I'm not seeing this with tkagg on 10.5. hist is working fine for me > both in ipython and running histogram_demo.py -- what tcl/tk are you > building against? I've just tried installing ActiveState's Tk/Tcl, but I get the following error when I try to plot anything: Exception in Tkinter callback Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__ return self.func(*args) File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py", line 188, in resize self.show() File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py", line 192, in draw tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File "/Library/Python/2.5/site-packages/matplotlib/backends/tkagg.py", line 15, in blit tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox)) TclError -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] hist() hangs on OSX 10.5
On Dec 3, 2007 11:04 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote: > Possibly related to the _tkagg extension -- that's what defines the > "PyAggImagePhoto" method. If you installed ActiveState's Tcl/Tk after > building matplotlib, that could explain this. Try doing a clean build > of matplotlib again (removing the build directory first). > > But that's only a suggestion -- I don't use Macs much. Thanks for the suggestion. I did do a fresh svn update and build after installing Tk/Tcl. -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] hist() hangs on OSX 10.5
On Dec 3, 2007 10:58 AM, John Hunter <[EMAIL PROTECTED]> wrote: > On Dec 2, 2007 9:23 PM, Chris Fonnesbeck <[EMAIL PROTECTED]> wrote: > > Running a recent build from svn on OSX 10.5, the TkAgg interface > > becomes unresponsive after plotting a histogram and calling show(). > > Here is a sample from the process, in case it is useful: > > Is it only hist that is hanging? Does plot work This one has me > a bit stumped. Same thing. Here is what I did: In [1]: from matplotlib import use In [2]: use('TkAgg') In [3]: from numpy import random In [4]: x = random.gamma(0.1, 1000, 1000) In [5]: from pylab import * In [6]: plot(x) Out[6]: [] In [7]: show() Exception in Tkinter callback Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__ return self.func(*args) File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py", line 188, in resize self.show() File "/Library/Python/2.5/site-packages/matplotlib/backends/backend_tkagg.py", line 192, in draw tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File "/Library/Python/2.5/site-packages/matplotlib/backends/tkagg.py", line 15, in blit tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox)) TclError -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] TypeError on CocoaAgg backend
OK, I'm having a bad backend day (insert joke here). Since I am on OSX, I decided to switch over to the CocoaAgg backend, but it fails when trying to show a histogram, yielding the following TypeError: In [4]: from matplotlib import use In [5]: use('CocoaAgg') In [6]: from pylab import hist, show In [7]: from numpy import random In [8]: x = random.exponential(2, 1000) In [9]: hist(x) Out[9]: (array([545, 230, 117, 59, 18, 15, 11, 1, 3, 1]), array([ 2.99606603e-03, 1.52977050e+00, 3.05654494e+00, 4.58331937e+00, 6.11009381e+00, 7.63686824e+00, 9.16364268e+00, 1.06904171e+01, 1.22171915e+01, 1.37439660e+01]), ) In [10]: show() --- TypeError Traceback (most recent call last) /Users/chris/Projects/Occupancy-abundance Manuscript/ in () /Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py in show() 44 def show(): 45 for manager in Gcf.get_all_fig_managers(): ---> 46 manager.show() 47 48 def draw_if_interactive(): /Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py in show(self) 203 mplBundle, 204 False) --> 205 NSApplication.sharedApplication().run() 206 207 /Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py in startWithBundle_(self, bundle) 179 def startWithBundle_(self, bundle): 180 #NSApplicationLoad() --> 181 if not bundle.loadNibFile_externalNameTable_withZone_('Matplotlib.nib', {}, None): 182 print >>sys.stderr, 'Unable to load Matplotlib Cocoa UI!' 183 sys.exit() /Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py in awakeFromNib(self) 79 80 self.plotView.setImageFrameStyle_(NSImageFrameGroove) ---> 81 self.plotView.image = NSImage.alloc().initWithSize_((0,0)) 82 self.plotView.setImage_(self.plotView.image) 83 TypeError: cannot change a method -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] TypeError on CocoaAgg backend
On Dec 3, 2007 7:34 PM, Barry Wark <[EMAIL PROTECTED]> wrote: > sorry instances of self.plotView.image > > On Dec 3, 2007 3:38 PM, Chris Fonnesbeck <[EMAIL PROTECTED]> wrote: > > I replaced the one instance of this that I found. I now get the following error: In [7]: show() --- ValueErrorTraceback (most recent call last) /Users/chris/ in () /Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py in show() 44 def show(): 45 for manager in Gcf.get_all_fig_managers(): ---> 46 manager.show() 47 48 def draw_if_interactive(): /Library/Python/2.5/site-packages/matplotlib/backends/backend_cocoaagg.py in show(self) 203 mplBundle, 204 False) --> 205 NSApplication.sharedApplication().run() 206 207 ValueError: NSInvalidArgumentException - NSImageCell's object value must be an NSImage. -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] hist() hangs on OSX 10.5
On Dec 3, 2007 9:41 PM, John Hunter <[EMAIL PROTECTED]> wrote: > On Dec 3, 2007 10:13 AM, John Hunter <[EMAIL PROTECTED]> wrote: > > > Sorry for the confusion, I was still on the *old* problem of tkagg > > hanging w/ hist, and was wondering if it was hanging with other plot > > commands too. Not that you can easily test now w/ the active tcl > > install. > > Chris, if you get some time to explore this further, I'd like to see > if we can sort it out. If you could remove the acive tcl and do a > clean rebuild of mpl, I'd like to verify the hang still exists, and > whether it is hist or all plot commands, and et some version info (eg > what tcl/tk) and see a copy of the mpl build output. Also, I'd like > to see a run w/ --verbose-debug output. I find it strange because I > am on the same platform and am not having any troubles (yet) with > tkagg. John, I removed ActiveTcl and the hang seems to have disappeared, both for hist and plot. cf -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib ignores CocoAff backend preference
I have the CocoaAgg backend specified in matplotlibrc in ~/.matplotlib/ as: backend : CocoaAgg However, when I plot, matplotlib uses the TkAgg backend in spite of this. -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib ignores CocoAff backend preference
Of course, I meant CocoaAgg, not -Aff. cf On Dec 4, 2007 1:49 PM, Chris Fonnesbeck <[EMAIL PROTECTED]> wrote: > I have the CocoaAgg backend specified in matplotlibrc in ~/.matplotlib/ as: > > backend : CocoaAgg > > However, when I plot, matplotlib uses the TkAgg backend in spite of this. > > -- > Christopher J. Fonnesbeck > + Fish & Wildlife Research Institute (FWC) > + 727.235.5570 > -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib ignores CocoaAgg backend in matplotlibrc
I have the CocoaAgg backend specified in matplotlibrc in ~/.matplotlib/ as: backend : CocoaAgg However, when I plot, matplotlib uses the TkAgg backend in spite of this. -- Christopher J. Fonnesbeck + Fish & Wildlife Research Institute (FWC) + 727.235.5570 - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] re sizing behaviour like in Mircrocal Origin
Jurgen, I generally lurk on the list, but I'll speak up now since I have basically done what you are talking about. I integrated MPL (TkAgg) into an existing application that resizes (PyRAF). The path I chose isn't particularly pretty, but it does the job and sounds like it might be flexible enough for what you are doing. I created an adapter class which wraps the MPL calls. The adapter is what the existing application calls to make plots instead of calling MPL directly. The adapter also keeps a normalized (0-1) copy of all plot data arrays (and any lines and other items). When the canvas is resized, I go through all my lines (Line2D), patches (Rectangle), and text, and scale each based on the new canvas dimensions. Then the new items are inserted directly into the Figure object, replacing the old values. This resizes everything so that it is correct when redrawn. I was initially concerned about performance, but the resizings are very smooth (thanks matplotlib!). You could also enforce an aspect ratio this way. I had to write this adapter not because of the resizing issue, but due to the constraints of the existing application with which I was working. It did however make resizing easy. As long as your plotted items are relatively simple (lines, patches, text), this works very well. Using more complicated items like legends would not work as well unless you either allowed them to stay a static size or manually composed them of simpler objects. In general, this idea is probably more work than John's DPI suggestions. Chris - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Fail to allocate bitmap, Unable to free colormap, palette is still selected.
hi Mike, It only prints what is between the , - . I tend to think it is related to Tkinter. I'm using the default GTKAgg. I have generated over 1500 images using the simple example with no issue. When it is in the larger app, it fails on the 2nd or 3rd request. I'm trying reload(matplotlib) matplotlib.use('TkAgg') Are there some python flags I can use when running the script to get more verbose output? I've used -v and -d and get the cleanup list, is that useful? thanks Michael Droettboom wrote: > Can you provide the full traceback for the error? Are there no Python > line numbers etc.? > > I don't see the string "Fail to allocate bitmap" or "Unable to free > colormap..." anywhere in the matplotlib source, so it's hard to say > where it's coming from. I suspect they are coming from the GUI > framework you are using... > > If you put your simple example inside of a loop, does the error > eventually occur -- or only within the context of your app? If the > latter, we'll need to somehow narrow it down to a specific setting or > method that causes the problem. > > Also, what backend are you using when it breaks? Just Agg, or one of > the Gui+Agg backends? > > Cheers, > Mike > > Chris Kennedy wrote: >> hi, >> I get this error when I'm generating numerous .png files using >> matplotlib 0.9.2 in py2.4 on WinXP >> - >> Fail to allocate bitmap >> >> This application has requested the Runtime to terminate it in an >> unusual way. >> Please contact the application's support team for more information. >> Unable to free colormap, palette is still selected. >> >> This application has requested the Runtime to terminate it in an >> unusual way. >> Please contact the application's support team for more information. >> - >> >> The code is simple: >> import matplotlib >> import matplotlib.pyplot as pylab >> >> pylabFigure = pylab.figure() >> pylabFigure.clf() >> pylab.rcdefaults() >> pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3) >> pylab.title('Endpointing Plot for '+StepMillName) >> pylab.xlabel('Mill Distance ('+m_unit+')') >> pylab.ylabel('~ Electron response ~' ) >> pylab.grid(True) >> pylabFigure.savefig('EPP_'+StepMillName+'.png', >> facecolor='lightgrey', edgecolor='w') >> pylab.close('all') >> pylabFigure = None >> >> I can put this code in a simple program and generate many images >> without seeing the allocate bitmap error. >> >> Perhaps it is colliding with something else in my main app. Is there >> a command that can clear, flush, or unselect the palette and/or >> colormap? >> >> I don't see the allocate error if I switch the backend to 'SVG', that >> has it own set of issues though: telling me it can't use, but then >> generating SVG files anyway. >> >> thanks >> > -- Chris Kennedy http://www.coventor.com Sr. Product ManagerPh: 919-854-7500 x156 Cary, NC Fx: 919-854-7501 Mobile: 919-414-6653 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Fail to allocate bitmap, Unable to free colormap, palette is still selected.
hi, I get this error when I'm generating numerous .png files using matplotlib 0.9.2 in py2.4 on WinXP - Fail to allocate bitmap This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Unable to free colormap, palette is still selected. This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. - The code is simple: import matplotlib import matplotlib.pyplot as pylab pylabFigure = pylab.figure() pylabFigure.clf() pylab.rcdefaults() pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3) pylab.title('Endpointing Plot for '+StepMillName) pylab.xlabel('Mill Distance ('+m_unit+')') pylab.ylabel('~ Electron response ~' ) pylab.grid(True) pylabFigure.savefig('EPP_'+StepMillName+'.png', facecolor='lightgrey', edgecolor='w') pylab.close('all') pylabFigure = None I can put this code in a simple program and generate many images without seeing the allocate bitmap error. Perhaps it is colliding with something else in my main app. Is there a command that can clear, flush, or unselect the palette and/or colormap? I don't see the allocate error if I switch the backend to 'SVG', that has it own set of issues though: telling me it can't use, but then generating SVG files anyway. thanks -- Chris Kennedy http://www.coventor.com Sr. Product ManagerPh: 919-854-7500 x156 Cary, NC - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Fail to allocate bitmap, Unable to free colormap, palette is still selected.
hi Mike, I was able to get it to work using: reload(matplotlib) matplotlib.use('Agg') I'll have to beat on it some more to see if this is robust. I saw the error message in this code: http://search.cpan.org/src/NI-S/Tk-804.027/pTk/mTk/win/tkWinDraw.c if(!bitmap) { panic("Fail to allocate bitmap\n"); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); return; } thanks Michael Droettboom wrote: > Can you provide the full traceback for the error? Are there no Python > line numbers etc.? > > I don't see the string "Fail to allocate bitmap" or "Unable to free > colormap..." anywhere in the matplotlib source, so it's hard to say > where it's coming from. I suspect they are coming from the GUI > framework you are using... > > If you put your simple example inside of a loop, does the error > eventually occur -- or only within the context of your app? If the > latter, we'll need to somehow narrow it down to a specific setting or > method that causes the problem. > > Also, what backend are you using when it breaks? Just Agg, or one of > the Gui+Agg backends? > > Cheers, > Mike > > Chris Kennedy wrote: >> hi, >> I get this error when I'm generating numerous .png files using >> matplotlib 0.9.2 in py2.4 on WinXP >> - >> Fail to allocate bitmap >> >> This application has requested the Runtime to terminate it in an >> unusual way. >> Please contact the application's support team for more information. >> Unable to free colormap, palette is still selected. >> >> This application has requested the Runtime to terminate it in an >> unusual way. >> Please contact the application's support team for more information. >> - >> >> The code is simple: >> import matplotlib >> import matplotlib.pyplot as pylab >> >> pylabFigure = pylab.figure() >> pylabFigure.clf() >> pylab.rcdefaults() >> pylab.plot(p[0::2], p[1::2], 'b-', linewidth=3) >> pylab.title('Endpointing Plot for '+StepMillName) >> pylab.xlabel('Mill Distance ('+m_unit+')') >> pylab.ylabel('~ Electron response ~' ) >> pylab.grid(True) >> pylabFigure.savefig('EPP_'+StepMillName+'.png', >> facecolor='lightgrey', edgecolor='w') >> pylab.close('all') >> pylabFigure = None >> >> I can put this code in a simple program and generate many images >> without seeing the allocate bitmap error. >> >> Perhaps it is colliding with something else in my main app. Is there >> a command that can clear, flush, or unselect the palette and/or >> colormap? >> >> I don't see the allocate error if I switch the backend to 'SVG', that >> has it own set of issues though: telling me it can't use, but then >> generating SVG files anyway. >> >> thanks >> > -- Chris Kennedy http://www.coventor.com Sr. Product ManagerPh: 919-854-7500 x156 Cary, NC - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Backend Agg - show plot
hi, try this. It is simpler then some of the examples: import pylab # func - list of X, Y coordinates func = [ 0, 0, 1, 2, 2, 3, 3, 2, 4, 1, 5, 1.4, ] # pylab.plot(func[0::2], func[1::2], 'b-', linewidth=3) pylab.title(' Plot for function ...') pylab.xlabel(' X name ') pylab.ylabel(' Y name ' ) pylab.grid(True) pylab.show() #pylab.savefig('blahblah.png', facecolor='lightgrey', edgecolor='w') pylab.close() # sa6113 wrote: Thanks alot for your help, I could show the plot on the screen on python 2.4 . I've used pyhton 2.3 . Eric Firing wrote: sa6113 wrote: How should I darw and show a plot using Backend Agg , I don't want to save figure , just show ? If you don't want to save a figure, then you will need an interactive backend--not Agg, but TkAgg or GtkAgg etc. Then you end your script with "show()" (imported from pylab or matplotlib.pyplot), and the plot will be diplayed on your screen. (The plain Agg backend is useful only with "savefig(...)" to generate png files.) Check out the "examples" directory in the distribution. Eric - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Chris Kennedy http://www.coventor.com Sr. Product ManagerPh: 919-854-7500 x156 Cary, NC Fx: 919-854-7501 Mobile: 919-414-6653 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] [newbie] "live" plots of multiple lines
Hi All, Apologies if I'm missing anything obvious... How do I plot lines point-by-point as opposed to by passing arrays? I'm guessing something like: plot([x],[y]) ...but that feels a bit weird to me. In any case, using that, I don't know how to plot more than one line at a time, so thought I'd ask here... Hope you can help! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Unable to Plot Date Axis Due To "TypeError: a float is required"
I'm getting a nonsensical error when attempting to make a simple plot with a date axis. Googling shows this similar errors, but none with a date axis. What could be causing this? >>> import datetime >>> from pylab import figure, show >>> fig = figure() >>> ax = fig.add_subplot(111) >>> dates = [datetime.date(2008, 1, 30),datetime.date(2008, 1, 31)] >>> values = [10.25, 10.0] >>> ax.plot_date(dates, values)#, '-') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 2585, in plot_date ret = self.plot(x, y, fmt, **kwargs) File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 2535, in plot for line in self._get_lines(*args, **kwargs): File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 428, in _grab_next_args for seg in self._plot_3_args(remaining, **kwargs): File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 404, in _plot_3_args func(x[:,j], y[:,j]) File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 385, in makeline axes=self.axes, File "/usr/lib/python2.5/site-packages/matplotlib/lines.py", line 226, in __init__ self.set_data(xdata, ydata) File "/usr/lib/python2.5/site-packages/matplotlib/lines.py", line 315, in set_data self.recache() File "/usr/lib/python2.5/site-packages/matplotlib/lines.py", line 320, in recache x = ma.asarray(self.convert_xunits(self._xorig), Float) File "/usr/lib/python2.5/site-packages/numpy/core/ma.py", line 2122, in asarray return array(data, dtype=dtype, copy=0) File "/usr/lib/python2.5/site-packages/numpy/core/ma.py", line 573, in __init__ self._data = c.astype(tc) TypeError: a float is required - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Matthias Michler wrote: > plot([x1], [y1], "bo", [x2], [y2], "r+") This didn't work :-S - the first time I call show(), execution never comes back to my script so the code never gets to plot any further points - if I put the "show" after the plotting loop (which means I don't get the "live plotting" I'm after) then there are no lines between the points (well, the points don't show at all, but I'm guessing it's because there's no lines between the points) - looking at the example, I'm left wondering how to pass keyword parameters such as "label" or use other methods such as plot_date Any help greatfully received! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Alan G Isaac wrote: > On Tue, 11 Mar 2008, Chris Withers apparently wrote: >> the first time I call show() > > http://matplotlib.sourceforge.net/faq.html#SHOW Okay, that tells me that I prettymuch don't want to be using show(), but I don't think I want interactive mode either... What I'm trying to do is run a script and plot-and-show as I go. The script reads the data to be plotted, but each set of points takes up to 20 minutes to generate, so I want to see the points appear on the graph as they arrive. Is this possible? If so, how? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Ryan May wrote: > > Right, the show() command starts the GUI's mainloop, which blocks > execution of the script until you close the figure. What you probably > want is something like the dynamic_demo.py example. ...which barfes for me: Traceback (most recent call last): File "dynamic_demo.py", line 3, in import gobject ImportError: No module named gobject What does that mean? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Chris Withers wrote: > Matthias Michler wrote: >> plot([x1], [y1], "bo", [x2], [y2], "r+") > > This didn't work :-S > > - the first time I call show(), execution never comes back to my script > so the code never gets to plot any further points Okay, thanks to Ryan, I now have this point fixed, however, with the following code: ion() i = 1 while i < 5: plot([i],[i],'go',[i],[i+2],'ro') print i i+=1 sleep(0.5) draw() - there are no lines between the points, how do I get the lines to show? - how would I pass keyword parameters such as "label" or use other methods such as plot_date? Also, when the above script finishes, I get: Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. What does that mean? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] visualisation for utility usage sought
Hi All, I hope this isn't considered off topic here, but this has been bugging me for a while and I reckon you guys may be able to help. To boot, I'd like to use matplotlib to make it happen, so I figure this list is fair game ;-) So, I have a series of measurements at points in time, eg: 2007/09/01 - 5000 2008/01/01 - 8000 2008/02/01 - 9000 ...and I'm looking to create some type of visualisation that indicates usage over time. The import point is that the gaps between point measurements are not constant, so a straight bar chart won't be right. The points also won't necessarilly be as convenient as those above, but hopefully they'll work as an example: What I'd expect to see would indicate that the monthly usage between September 1st and January 1st was, on average, the same as that between January 1st and February 1st. I'm having trouble expressing myself clearly, but hopefully I'm making some kind of sense. Any ideas very greatfully recieved! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Export plot to Word
Cheng-Kong Wu wrote: > I created several plots and want to export them to a > Word file sequentially, how can I do that? Why Word? It's a horrible file format and very difficult to deal with. Why not just use one of the PDF backends (I don't think I'm making that up, there are PDF back ends for Matplotlib, right?) If you really insist on trying with Word, your best bet is to interact with Word via the win32com package... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] visualisation for utility usage sought
(meant this to go to the list too) Christiaan Putter wrote: > I'm having trouble understanding what it is you exactly want. That's likely my fault ;-) > You said you want to indicate that 'the monthly usage between September 1st > and January 1st > was, on average, the same as that between January 1st and February 1st.' Yes, but "monthly" is a red herring here, the time periods are however long it's been since myself or the utility company checked the meter ;-) > The measurement your taking is not in fact the utility usage for one month, > but rather the sum of all usage over all prior months. Not really, and this was definitely me being unclear... We're talking about utility meters here, so you go and look at them and they show how many units of whatever it is (water, electicity, etc) they have delivered. So, that's how you get the time series (with more variation, to show reality, and avoid red herrings like "month"): 2007/09/13 - 5000 2008/01/02 - 8000 2008/02/08 - 9000 2008/02/12 - 9100 So, the differences tell us: Between 2007-09-13 and 2008-01-02, 3000 units were used Between 2007-01-02 and 2008-02-08, 1000 units were used Between 2007-02-08 and 2008-02-12, 100 units were used So I guess it's this data that I'm looking to visualise in such a way that it's apprarent how much of the utility is being per unit time. NB: The measurements aren't regular, since they often come from when a person turns up and reads the meter, which isn't at all regular ;-) Does that make more sense? Any ideas? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plotting with missing data?
Hi All, Say I have data that looks like: date x y z 2008-01-01 10 2008-01-02 21 11 2008-01-02 32 15 5 How can I plot it such that all three lines are plotted by that it's apparent two of them are missing some data? (I know I could just sub in zeros for the missing values, but I'd like the point not to be there, not just down the bottom of the graph...) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting with missing data?
Eric Firing wrote: > Chris, > > Use masked arrays. See masked_demo.py in the mpl examples subdirectory. Hi Eric, I took a look at that, but it uses: import matplotlib.numerix.npyma as ma ...and matplotlib.numerix isn't listed in the API reference. Where are the docs for this? Specifically, what I have is an array like so: ['','','',1.1,2.2] I want to mask the strings out so I don't get ValueErrors raised when I call plot functions with that array. How should I do that? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] placing legend outside of plot area
Hi All, How would I go about placing the legend outside the plot area? All the parameters to legend seem to place the legend somewhere within the plot and I'd like to place it outside the plot, either above, below or, most commonly, to the right, in the same way as the Excel legend positions allow. cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] matplotlib threadsafe?
Hi All, I'm wondering what work people have done with matplotlib in multi-threaded environments such as your average python web framework. Is matplotlib threadsafe? How have people gone about safely using it in a multi-threaded environment? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] how to remove an xlabel?
Hi All, I'm using plot_date to plot some dates, but this sets an xlabel, and I don't want the plot to have an xlabel. How do I remove it? I tried: xlabel(None) ...but that just set the xlabel to 'None'... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] placing legend outside of plot area
Hi Matthias, Matthias Michler wrote: > I'm not sure if there was an example in matplotlib, but the following works > for me: > - > from pylab import * > figure() > subplot(111) > subplots_adjust(right=0.7) > plot(arange(10), label='linear') > plot(arange(10)**2, label='quadratic') > legend(loc=(1.1,0.5)) > show() > Thanks for this. This is exactly what I was after except that the legend now appears about 25% off the right hand of the screen or whatever I save the figure to. How can I have the legend as placed above but with the whole of it showing? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] how to remove an xlabel?
Matthias Michler wrote: > you can try xlabel of an empty string: > > xlabel(' ') Thanks, and yes, a truly empty string xlabel(''), works :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] making minor ticks into lines instead of ticks
Hi All, How do I go about showing minor ticks as lines across the whole plot, as opposed to just little ticks at the side? I can get the major ticks to show by doing grid(True), but how do I get the same effect for minor ticks? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] placing legend outside of plot area
Matthias Michler wrote: > sorry I don't understand what you are exactly looking for. Maybe you could > explain it once more. Well, what you provided was pretty close, it's just that the legend was partly placed outside the figure... > In general I think all one can do is to play around with the parameters > in 'subplots_adjust' and the location in 'legend' to get the best result. > I'm not an expert but I think there's no default behaviour covering all needs > (outside the axes and best located), because for example the legend width is > influenced by the length of the labels. Right, this is the problem. The location your example provided is perfect, except that I may have no control over the length of the legend text, and so need to find a way to make sure the figure size is such that the legend doesn't end up being half off the figure... Anyone know how to do that? (and thanks to Matthias for all his help! :-) ) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] making minor ticks into lines instead of ticks
Eric Firing wrote: >> I can get the major ticks to show by doing grid(True), but how do I >> get the same effect for minor ticks? > > Try > > grid(True, which='minor') Thanks, that worked (well, it did what it was supposed to...) so it'd be nice if it was in the online docs as well as the docstring of the method;-) However, this isn't quite what I want... I only want the grid for the y-axis (ie: horizontal lines in the grid, but no vertical), how would I do that? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting with missing data?
Eric Firing wrote: >> Specifically, what I have is an array like so: >> >> ['','','',1.1,2.2] > > Try something like this: > > import numpy.ma as ma > from pylab import * > > aa = [3.4, 2.5, '','','',1.1,2.2] > def to_num(arg): > if arg == '': > return .0 > return arg > > aanum = array([to_num(arg) for arg in aa]) > aamasked = ma.masked_where(aanum==.0, aanum) > plot(aamasked) > show() What I ended up doing was getting my array to look like: from numpy import nan aa = [3.4,2.5,nan,nan,nan,1.1,2.2] values = numpy.array(aa) values = numpy.ma.masked_equal(values,nan) I only wish that masked_equal didn't blow up when aa contains datetime objects :-( cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] placing legend outside of plot area
Eric Firing wrote: > It sounds like what you want it the pyplot figlegend command: > def figlegend(handles, labels, loc, **kwargs): This feels like what I should be wanting except: - why does it need explicit parameters? why can't it pick up its lines and labels automatically, like legend does? - it places the legend over the top of the current chart, I want it to the right, so it doesn't obscure the information on the chart... > or you could directly use the Figure.legend method. How does this differ from the normal legend command? How do I get hold of a figure to call its legend method? How does figure.legend interact with subplots? I have a bout 6 subplots on the same figure(?) and they each need to have a legend which is not obscuring the data plotted and isn't obscuring any other figure... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] from pylab import nx?
Hi All, A few of the units demos include the lines: from pylab import nx ...but this import errors for me. Why is that? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] making minor ticks into lines instead of ticks
Matthias Michler wrote: > ax.yaxis.grid(which='minor') This is what I was after, thankyou :-) However, the lines show up on top of the lines plotted, not behind them as I'd expect. I tried fiddling with the zorder of the plot and the grid but nothing had any effect. What am I doing wrong? How do I get the grid to show up behind the lines? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] default zorder for plots?
Chris Withers wrote: > I tried fiddling with the zorder of the plot and the grid but nothing > had any effect. What am I doing wrong? How do I get the grid to show up > behind the lines? Actually, I did manage to fix this by specifying a zorder of 10 for the plots and a zorder of 1 for the grids. What's the default zorder? Ideally I'd just like to supply the zorder to the grids... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] bar chart with dates on x-axis blows up
Hi All, I'm trying to plot a bar chart something like: from pylab import * from datetime import datetime,timedelta now = datetime.now() data1 = [1,2,3] data2 = [4,5,6] labels = [now-timedelta(1),now,now+timedelta(1)] bar(labels,data1) show() However, this blows up: Traceback (most recent call last): bar(labels,data1) File "matplotlib\pyplot.py", line 1402, in bar ret = gca().bar(*args, **kwargs) File "matplotlib\axes.py", line 3294, in bar self.add_patch(r) File "matplotlib\axes.py", line 1146, in add_patch self._update_patch_limits(p) File "matplotlib\axes.py", line 1152, in _update_patch_limits xys = self._get_verts_in_data_coords( File "matplotlib\patches.py", line 362, in get_verts right = self.convert_xunits(x + self.width) TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'float' What am I doing wrong? Also, how do I go about adding a second set of bars? (ie: from data2)? (Bear in mind that in the real use, there are over 600 days worth of data, so I want to take advantage of the normal tick locators, etc as much as possible...) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] default zorder for plots?
Hi Matthias, Matthias Michler wrote: > in "examples/zorder_demo.py" I found: > --- > The default drawing order for axes is patches, lines, text. This > order is determined by the zorder attribute. The following defaults > are set > > Artist Z-order > Patch / PatchCollection 1 > Line2D / LineCollection 2 > Text 3 > - So I see, but then why if I set the zorder of the grid to 0 or 1, does it still show up on top of the lines, unless I set the zorder of the lines to 10 or above? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] placing legend outside of plot area
Matthias Michler wrote: > - I think this could be a good improvement, but i'm not sure if it is easy to > expand the functionality of the axes-legend (pyplot.legend or ax.legend) to > that of a figure-legend(pyplot.figlegend or fig.legend with fig as a figure > instance) without missing something, because there is no axes specified and > therefore it is not obvious which lines should be displayed. True, although if there's only one axes, it's obvious ;-) (and if there's more than one, it should take an axes as a keyword parameter) > In that case the > default behaviour might become to take all lines from all axes and that's not > what one always needs, or isn't it? Who knows, maybe someone would want that? The joy of building generic tools ;-) > ax1 = subplot(111) > # some plotting commands > labels = [] > for line in ax1.lines: > label = line.get_label() > labels.append(label) > # or in one line: > # labels = [line.get_label() for line in ax1.lines] > figlegend(ax1.lines, labels, 'upper right') Yes, you see, it just feels to me like figlegend should have this code in it as it's likely to be duplicated every time I need to call figlegend. Why not just? figlegend(axes=ax1,'upper right') >> - it places the legend over the top of the current chart, I want it to >> the right, so it doesn't obscure the information on the chart... > > That's true and I have no idea how to overcome that (except for example > subplot_adjust(top=0.8)). Yes, I'm just making do with this for now, but it would be really nice if MPL supported legends outsite the axes properly. It would also be good if you didn't have to manually fiddle with subplot_adjust because you rotated the labels for the x-axis through 90 degrees :-( >> How does figure.legend interact with subplots? > I'm don't know, but maybe it doesn't interact with the axes / subplots at all. 'badly' I think is the best summary of the interaction ;-) > I think in that case the axes-legend is the preferred one, but I have no idea > how to ensure that nothing is cover by the legend without difficult tuning of > the parameters or at least ensure that all labels have the same widths. Yeah :-/ This is where I am... If anyone has any magic code or suggestions, I'd love to hear 'em ;-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Gappy bars when no edge specified?
Hi All, Why does the following render small gaps horizontally between the bars? import pylab data = [1,2,1,2,4,2] labels = pylab.arange(len(data1)) pylab.bar(labels,data1,width=1,linewidth=0) pylab.show() How do I make the small gaps go away? cheers, Chris - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] gradient fills for bar charts?
Hi All, Is there any way in MPL to do gradient filled bars like you can in Excel? (click data series -> format data series -> patterns -> fill effects -> gradient -> diagonal up) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Gappy bars when no edge specified?
Eric Firing wrote: >> How do I make the small gaps go away? > > With svn I don't see any gaps in the example above, either on screen or > when saved to a png file. That's cool'n'all, but when is svn going to make it into a Windows binary release? ;-) cheers, Chris - not sure how to compile MPL on Windows :-( -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] gradient fills for bar charts?
Eric Firing wrote: > Short of laboriously putting an image in each bar, no. That's a shame :-( So, no gradient filled patches in MPL? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting with missing data?
Pierre GM wrote: > Could you send me an example of the kind of data you're using ? It's basically performance and volume data for a high-volume website. Unfortunately, the data is gappy in places due to data collection errors in the past... (it's important the gaps are shown, rather than trying to interpolate them away, however) > As it seems you're dealing with series indexed in time, you may want to try > scikits.timeseries, a package Matt Knox and myself implemented for that very > reason. How would this help me here and where can I find out about it? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plotting filled lines with missing data?
Eric Firing wrote: > This is not doing what you think it is, Indeed, I guess I was seeing nans being treated as missing values rather than being masked... > You should use numpy.masked_where(numpy.isnan(aa), aa). I am now ;-) However, I'm still running into problems when I try and plot the gappy data on a filled line as follows: dates = *an array of datetimes* values = *an array containing data values and a few nans* values = numpy.ma.masked_where(numpy.isnan(values),values) xs,ys = mlab.poly_between(dates,0,values) pylab.fill(xs,ys,'r') For starters, I get this warning: numpy\core\ma.py:609: UserWarning: Cannot automatically convert masked array to numeric because data is masked in one or more locations. ...and wherever a NaN occurs in the data, the line is plotted off the top of the axes. I want it to appear at 0 if there's no data. Well, ideally just not appear at all, but I'd settle for appearing at 0... Any ideas? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting filled lines with missing data?
Eric Firing wrote: > Both with respect to documentation and functionality, what you are > encountering is the historical aspect of masked arrays as a tacked-on > part of python numeric packages, and of matplotlib. *sigh* I feel lucky ;-) > Support and > integration are improving, but still far from perfect. I wish I could help, but my knowledge is lacking... > Now with respect to your particular case here, trying to plot a filled > line with gaps: poly_between has no notion of masked arrays at present. > If it did, how should it behave? Well, what I actually settled on was juat doing using: my_masked_array.filled(0) ...to plot with. > At the very least, additional > arguments are needed to specify what should happen for fill-type > plotting with missing values. Indeed, what I personally would have liked was a complete gap where the data is missing, but I guess that would have to return multiple polygons, and I don't know how that would work? > provide them in mpl. I would be happy to fix this gap in mpl's handling > of gappy data, ...heh ;-) > but I can't make it a priority use of my time right now. No, I understand :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting with missing data?
Giorgio F. Gilestro wrote: > > import numpy as np > a = ['','','',1.1,2.2] > mask_a = [i == '' for i in a] > b = np.ma.MaskedArray(a, mask=mask_a) Not very efficient, though, is it? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib threadsafe?
Michael Droettboom wrote: > At least the Agg backend *looks* to be reasonably threadsafe -- there > are no obvious gotchas like global variables etc. Note, though, that > multithreading may not gain much in the way of performance since the > global interpreter lock is never released around long-running C blocks. It's not performance I'm looking for, it's making sure that MPL apps served from multi-threaded wsgi servers don't screw each others charts up ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib threadsafe?
Eric Firing wrote: > In general, I don't think mpl is threadsafe at all; it uses global > variables, such as all the rc parameters, that could easily be modified > by one thread while being used by another. Yep, I guessed as much, BFL it is then ;-) > I think that great care > would be needed if one wanted to have multiple threads making plots. > Having one plotting thread and any number of threads doing other things, > however, should be OK. Out of interest, how does one tell MPL to "start a new figure and forget everything that's gone before"? > At the very least, I think we would have to take all the global state > information and put it in a class instance, so there could be multiple > plotting machines. Yes. cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] from pylab import nx?
Eric Firing wrote: > If you are referring to scripts in the matplotlib/examples/ subdirectory > then you must have a version in which some of those scripts had not been > brought up to date with the rest of matplotlib. You should turn them into unit tests as well as examples. I'm about to try and do this, time permiting, for xlwt (small plug - it's great for generating formatted excel files from raw data, just as xlrd is for extracting data and formatting from excel files, sadly, neither can do charting with excel, which is why I'm learning to love and hate numpy and matplotlib ;-) ) Out of interest, does MPL have unit tests? It should ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] bar chart with dates on x-axis blows up
[re-adding in the list] Eric Firing wrote: > It looks like you have hit a bug that has been fixed. I don't know when > it was fixed, but your example works with svn. As I said elsewhere, with all the fixes, maybe it's time for a new release? ;-) > Also, you can call bar repeatedly; I think it will just keep adding the > new bars, resizing the plot as needed. Everything has to be done before > the show() command, though. I don't think I was clear enough.. I want to do all the plotting at one time, but looking at the example, it appears that you have to do much more work as a user if you want bar charts where the bars are side-by-side than if you use a line plot. Are bar charts a relatively new addition? They feel less slick to use than the other options :-S cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] compiling from svn on windows
Michael Droettboom wrote: >> That's cool'n'all, but when is svn going to make it into a Windows >> binary release? ;-) >> > I suspect your question is somewhat rhetorical, but... it will probably > be a while ;) Why is that? Who cranks out the binary releases on Windows and what compiler do they use? > I know a lot of people (myself included) have had success with MinGW. What's the "official" compiler used, though? > It's a good learning experience, and there's lots on this list willing > to help. If we can get more SVN Windows users on board, more crazy > Windows-only bugs will get found and squashed sooner... ;) Well, tell me how to get the svn trunk and how to compile and I'll give it a go :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plotting dates on the Y axis?
Kenneth Miller wrote: > Is it possible to plot dates on the Y-axis? I'd like to have > dates on the y axis descending or ascending versus my values on the x > - axis. Is it possible to do this or simply switch the axis? Not sure what you mean, have you just tried it with plot or plot_dates? What problems are you experiencing? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plotting filled lines with missing data?
Pierre GM wrote: > Your data is indexed in time, right ? Your x-axis is a date object ? Then use > scikits.timeseries > http://scipy.org/scipy/scikits/wiki/TimeSeries I'm not sure what this is giving me. The dates are all python datetimes in a list already. The missing values started off as '', I turned those into nan and then created a ma with the nan's masked. What more would TimeSeries give me? > the link above. I must admit we didn't implement poly_between for timeseries. > Most likely, we'd have to implement it for regular masked arrays first, as > mentioned by Eric. OK. > What you could do is to fill your array with some kind of baseline, such as > 0, > or your minimum data, or wtvr. That's just a quick trick and no fix. Indeed, that's what I had to do. I have to admit, I see some interesting things while scanning that wiki page, but nothing that would have helped me... cheers, Chris (who might well be missing something...) -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] from pylab import nx?
Michael Droettboom wrote: > The "backend_driver.py" example runs a number of other examples using a > number of different backends. That's been a reasonably successful set > of regression and coverage tests. It's not perfect, but it's a start. > There are also some lower-level unit tests for frequently-reoccurring > bugs in the unit directory. Indeed, is there any kind of "full unit test" suite that a developer can run when changing things ot make sure they haven't fubarred anything? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plotting dates on the Y axis?
Kenneth Miller wrote: > > back in time. When i pass plot_dates timestamps for the y axis, and > integers for the x axis it simply displays the y-axis as floats. did you try: plot_dates(x,dates,ydate=True) ? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Hey Matthias, Matthias Michler wrote: > maybe something like the following helps you: > - > from pylab import * > from time import sleep > > ion() # interactive mode 'on' > figure() > ax = subplot(111, autoscale_on=True) > > x, y = [0], [0] > line = plot(x, y, label="my_data")[0] > # get the line-object as the first > element > # of the tuple returned by plot > legend() > for i in arange(10): > x.append(i) # append new values > y.append(i**2) > line.set_data(x,y)# reset data > ax.relim()# reset axes limits > ax.autoscale_view() # rescale axes > draw()# redraw current figure > sleep(0.5)# wait 0.5 seconds > > ioff() This is perfect, except for one little thing... My x-axis is time, and as new points are plotted, even though I'm following the above recipe pretty closely, the x-tick spacing isn't getting sorted out, so I end up with just a jumble as the tick labels for the x-axis. Do you know why this might be? > I don't know how to make this somehow interactive concerning the data input. > but maybe you save the data to a file and read them every 15 or 20 minutes. This isn't a problem, I just run in a "while True" loop and leave it running until I close the plot window. Shame I get that horrible exception when I do close the plot window, wish I knew how to make it stop :-S cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Runtime Error
Hi Brook, Brook Lin wrote: > raise RuntimeError("'%s' is not a writable dir; you must set > %s/.matplotlib to be a writable dir. You can also set environment variable > MPLCONFIGDIR to any writable directory where you want matplotlib data stored > "%h) This is the crucial bit. Looks like you've set MPLCONFIGDIR to a read-only dir, or the .matplotlib in the current dir or .matplotlib in your home directory aren't writeable by the user running your python script. (I'm doing a bit of guesswork here...) What is it that you're trying to do? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I really need help about installing matplotlib.
lovegf86 wrote: > What is the problem? > Do I need to update numpy? > Please help me, I am so desperate.. Install Python 2.5 from here: http://python.org/ftp/python/2.5.2/python-2.5.2.msi Install NumPy from here: http://downloads.sourceforge.net/numpy/numpy-1.0.4.win32-p3-py2.5.exe Install the windows binary for python 2.5 from here: http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2.win32-py2.5.exe Ignore the Enthought stuff ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Matthias Michler wrote: My x-axis is time, and as new points are plotted, even though I'm following the above recipe pretty closely, the x-tick spacing isn't getting sorted out, so I end up with just a jumble as the tick labels for the x-axis. Do you know why this might be? I'm not sure I understand correctly, but if the number of xticks increases dramatically (nobody could see the individual ticks), Indeed, it looks like the Tick spacing is staying as it was when the first point was plotted, so when hundreds more points are plotted, I just get a jumble of labels on the x-axis. the above script leads to a different behaviour on my system. What is that behaviour and what version of matplotlib are you using? Shame I get that horrible exception when I do close the plot window, wish I knew how to make it stop :-S I don't know which exception you refer to, but sometimes if gives problems if the interactive mode wasn't switched off ("ioff()") before the scripts ends or "show()" is called. If I run the attached script, and hit Ctrl-C in the DOS box running it, I get: C:\>python mpltest.py Traceback (most recent call last): File "mpltest.py", line 3, in show() File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py", li e 76, in show Tk.mainloop() File "C:\Python25\lib\lib-tk\Tkinter.py", line 328, in mainloop _default_root.tk.mainloop(n) KeyboardInterrupt Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. I've had a similar error when I hit the red cross in the corner of the window with other scripts, although not this one :-S cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk from pylab import * plot([1,2],[3,4]) show() - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Matthias Michler wrote: >>> the above script leads >>> to a different behaviour on my system. >> What is that behaviour and what version of matplotlib are you using? > > I think it is the expected behaviour. The number of xtick is aproximately > constant and some tick get sorted out, when the xlimits are increasing. > I'm using matplotlib-svn r5024 on Debian etch. Hmm, do you have a code snippet to demonstrate this? Maybe I'm missing some vital step that causes the axis to re-calculate its ticks? > sorry. I have no idea where this problems comes from. I have seen that using > idle and the latest release of matplotlib on and winxp, but I can't reproduce > it on my linux system. *sigh* ;-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Matthias Michler wrote: > I'm not sure that I understand you correctly. The code I refering is the one > which I attached some mails ago. The following works for me: Ah, okay, to get the problem I was having, change your script as follows: > - > from pylab import * > from datetime import datetime > from time import sleep > > ion() # interactive mode 'on' > figure() > ax = subplot(111, autoscale_on=True) > > x, y = [datetime.now()], [0] > line = plot(x, y, label="my_data")[0] > # get the line-object as the first > element > # of the tuple returned by plot > legend() > for i in arange(30): > x.append(datetime.now()) # append new values > y.append(i**2) > line.set_data(x,y)# reset data > ax.relim()# reset axes limits > ax.autoscale_view() # rescale axes > draw()# redraw current figure > sleep(0.3)# wait 0.3 seconds > > ioff() > show() So, basically make the x axis time instead of numbers. I think the problem is actually that the daets are quite long in their format. If they were rotated through 90 degress it'd likely be fine. How would I do this? Also, how would I get this kind of updating with bar charts or errorbars? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [newbie] "live" plots of multiple lines
Matthias Michler wrote: > I'm not sure it is the easiest way, but it works for me: > > for label in ax.xaxis.get_majorticklabels(): > label.set_rotation(+90) Yes, that's what I was using, just wondered if there was a better way... >> Also, how would I get this kind of updating with bar charts or errorbars? > > In the case of bar charts and errorbars it is quite difficult to reset the > data. Oh, I also meant to ask about scatter, can the data be easilly reset there? For bar charts and errorbar plots, I agree ;-) How would I just blank the figure and replot? (I have just been calling errorbar lots, but I'm guessing that if I add a legend, I'll have one entry for each time I called errorbar :-S) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] wxagg back-end bug on windows?
Hi all, I'm having an odd issue with the wxAgg back-end: windows XP python 2.5.2 (from python.org) wxPython 2.8.7.1 unicode (binary from wxPython.org) MPL 0.91.2 (binary from MPl site) when I run: import matplotlib matplotlib.use('wxagg') import pylab I get a popup dialog: "This application failed to start because wxmsw26uh_vc.dll was not found" It looks like it is looking for a wxPython2.6 dll, which it doesn't find, because I'm running wxPython2.8 I'm guessing this binary was compiled against wxPython2.6, but I thought the current wxAgg back-end didn't try to use the accelerated module for wxPython2.8. Any ideas? By the way, there are a number of other small bugs cropping up in the pylab window with wxagg too -- but I'll look at those once I solve this. Is no one else using MPL with wxPython2.8? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] wxagg back-end bug on windows?
Chris Barker wrote: > Hi all, > > I'm having an odd issue with the wxAgg back-end: Update: If I remove: matplotlib/backends/_wxagg.pyd The problem goes away. It looks like that pyd is getting loaded even though I'm running wxPython2.8 However, now I get a non-valid png when I do savefig -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] C++ Assertion failure during savefig
Hey, Up until recently I have been using mpl 0.90.1, and my application worked fine. Yesterday I upgraded to 0.91.2 and am now getting the following traceback: File "application. py", line 667, in plot radial_plot_figure.savefig(png_file, dpi=self.dpi) File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 770, in savefig self.canvas.print_figure(*args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 101, in print_figu re FigureCanvasAgg.print_figure(self, filename, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1202, in print_figure self.figure.canvas.draw() File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", line 65, in draw self.gui_repaint() File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 987, in gui_repaint drawDC.DrawBitmap(self.bitmap, 0, 0) File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 3387, in DrawBitmap return _gdi_.DC_DrawBitmap(*args, **kwargs) PyAssertionError: C++ assertion "hdcDst && hdcSrc" failed at ..\..\src\msw\dc.cpp(2559) in AlphaBlt( ): AlphaBlt(): invalid HDC Does anyone have any suggestions to why this is happening? Thanks. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plotting from a dictionary
Hey All, I have a dictionary that maps date to a count (in this case the number of false negatives from my spam filter) and I'm wondering how to best plot something that looks like, say: from datetime import date data = { date(2008,03,01):10, date(2008,03,02):15, date(2008,03,03):13, } I'm worried about getting the dates out in order such that I get a straight line plot, rather than the zigzag back-and-forth line I reckon I'd get if I did: dates = [] count = [] for date,count in data.items: dates.append(date) count.append(count) plot(dates,counts) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] matplotlib threadsafe?
Eric Firing wrote: > >> Out of interest, how does one tell MPL to "start a new figure and >> forget everything that's gone before"? > > You can minimize the amount of package and module-level state > information by using the oo interface: see examples/agg_oo.py. I tried this example, and it generates no output. Is that to be expected? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] location of figure window
Hey All, Is there any way I can control the location that a tk figure window is shown on screen? I can control the size fine with: pylab.figure(figsize=(10,10)) ...but this produces a figure that, while it's the right size, is rendered with the top left of the window in the middle of the screen. If I can get it to be to-left, then it will all be visisble without me having to move it with a mouse ;-). Any ideas? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] MPL, py2exe and fonts
Hi all, I'm successfully getting all the MPL data files into spy2exe with: DATA_FILES = matplotlib.get_py2exe_datafiles() The problem is that that dumps a LOT of stuff, and I don't need most of it. I've already added to my script a few lines that delete the "images" dir, but I'd like to trim down the fonts to just those I need. I'm using the wxAgg back-end, with all default fonts -- does anyone know which those are? MPL version: 0.91.2 on Windows (duh!) by the way, is there any way to dump that data into the exe itself, rather than requiring it to be carried alongside? This makes me really appreciate application bundles on the Mac! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MPL, py2exe and fonts
Michael Droettboom wrote: > Chris Barker wrote: >> I'm successfully getting all the MPL data files into spy2exe with: >> >> DATA_FILES = matplotlib.get_py2exe_datafiles() >> >> The problem is that that dumps a LOT of stuff, and I don't need most >> of it. > The default text font is Vera.ttf. (If you want to support bold and > italic etc, you'll also need VeraBd.tff, VeraBI.ttf and VeraIt.ttf). I removed all other fonts, and it works fine, thanks! > Alternatively, you can change the default fonts in the matplotlibrc to > ones that are included with Windows (e.g. Arial) -- I took a look in matplotlibrc, and saw what looks like a html-ish cascade of fonts to look for, and Arial was in there. So I tried removing all the fonts, and behold, the system fonts were used. So now all I have in the mpl-data dir is matplotlibrc. Then I thought, I haven't changed any defaults in matplotlibrc, either, so I pulled that out. Now it runs fine, but when I close, I get an error box: see the logfile: and indeed there is a pH.exe.log file, and in there is: C:\Documents and Settings\chris.barker\My Documents\HAZMAT\SmallTools\phCalculator\trunk\dist\pH.exe\matplotlib\__init__.py:520: UserWarning: Could not find matplotlibrc; using defaults C:\Documents and Settings\chris.barker\My Documents\HAZMAT\SmallTools\phCalculator\trunk\dist\pH.exe\matplotlib\__init__.py:566: UserWarning: could not find rc file; returning defaults Is there a way to supress those warnings and not write the logfile? I've never really liked matplotlibrc -- it's kind of nice not to have it at all, and it doesn't seem to be required. Maybe this is a wx issue -- how to bury that warning. So then I tried removing mpl-data, but the app wouldn't run, I got an error, and the logfile says: Traceback (most recent call last): File "pH.py", line 8, in File "zipextimporter.pyo", line 82, in load_module File "Lib\Gui.pyo", line 15, in File "wxaddons\__init__.pyo", line 180, in import_hook File "zipextimporter.pyo", line 82, in load_module File "matplotlib\__init__.pyo", line 639, in File "matplotlib\__init__.pyo", line 562, in rc_params File "matplotlib\__init__.pyo", line 517, in matplotlib_fname File "matplotlib\__init__.pyo", line 207, in wrapper File "matplotlib\__init__.pyo", line 447, in _get_data_path_cached File "matplotlib\__init__.pyo", line 443, in _get_data_path RuntimeError: Could not find the matplotlib data files since I'm not, in fact needing any of the files in mpl-data, it might be nice if this error could be moved to when it's actually needed. I do notice that there is already a "if getattr(sys,'frozen',None)" stanza, so maybe we could tweak something there. This may all be a pain, and I suppose this approach would only work with the simplest of MPL apps (like mine), but it would be nice to clean up MPL so that it plays better with py2exe and the like. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Missing dll in windows build 0.87.4
I am trying to run Matplotlib 0.87.4 on WinXP after having installed from the binaries posted on sourceforge. Unfortunately, when I try importing from pylab, I get a popup declaring:"This application has failed to start because MSVCP71.dll was not found."I usually work on Mac/Linux, so I have no idea what this means. Here is the traceback.Traceback (most recent call last): File "", line 1, in ? File "c:\python24\lib\site-packages\matplotlib-0.87.4-py2.4-win32.egg\pylab.py", line 1, in ? from matplotlib.pylab import * File "c:\python24\lib\site-packages\matplotlib-0.87.4-py2.4-win32.egg\matplotl ib\pylab.py", line 200, in ? from axes import Axes, PolarAxes File "c:\python24\lib\site-packages\matplotlib-0.87.4-py2.4-win32.egg\matplotlib\axes.py", line 14, in ? from artist import Artist, setp File "c:\python24\lib\site-packages\matplotlib-0.87.4-py2.4-win32.egg\matplotlib\artist.py", line 4, in ? from transforms import identity_transform File "c:\python24\lib\site-packages\matplotlib- 0.87.4-py2.4-win32.egg\matplotlib\transforms.py", line 215, in ? from _transforms import Value, Point, Interval, Bbox, Affine File "c:\python24\lib\site-packages\matplotlib-0.87.4-py2.4-win32.egg\matplotl ib\_transforms.py", line 17, in ? from matplotlib._ns_transforms import *ImportError: DLL load failed: The specified module could not be found.I have tried building matplotlib myself using mingw32, but with no success. Any help is most appreciated. -- Chris Fonnesbeck + Atlanta, GA + http://trichech.us - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Missing dll in windows build 0.87.4
On 7/23/06, Charlie Moad <[EMAIL PROTECTED]> wrote: > The mingw/2.4 build still works. There are instructions at the top of > the setupext.py file. The dll linking error you are getting is > something we ran into a lot. If you have numpy installed distutils > will use the numpy\distutils\mingw32ccompiler.py file. In the > Mingw32CCompiler class remove all links to "msvcr71". In my version > of numpy just comment out the whole if block at line 127. > I tried commenting out that very block, but then numpy will not build -- it does not see the mingw32 compiler without those lines, it appears. I used the --compiler switch on the build, but to no avail. I'm a bit stuck here, as matplotlib does not build, and the binary does not seem to work. I'm trying to put together a package that contains numpy, matplotlib and scipy to distribute to some of my users. Thanks, -- Chris Fonnesbeck + Atlanta, GA + http://trichech.us - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Missing dll in windows build 0.87.4
And by the way, trying to build matplotlib myself with the numpy binary installed, fails. It appears to be related to tkagg: src/_tkagg.cpp:28:18: tk.h: No such file or directory src/_tkagg.cpp:36: syntax error before `*' token src/_tkagg.cpp:40: `ClientData' was not declared in this scope src/_tkagg.cpp:40: parse error before `,' token src/_tkagg.cpp: In function `int PyAggImagePhoto(...)': src/_tkagg.cpp:43: `Tk_PhotoHandle' undeclared (first use this function) src/_tkagg.cpp:43: (Each undeclared identifier is reported only once for each function it appears in.) src/_tkagg.cpp:43: parse error before `;' token src/_tkagg.cpp:44: `Tk_PhotoImageBlock' undeclared (first use this function) src/_tkagg.cpp:56: `argc' undeclared (first use this function) src/_tkagg.cpp:57: `interp' undeclared (first use this function) src/_tkagg.cpp:57: `argv' undeclared (first use this function) src/_tkagg.cpp:58: `Tcl_AppendResult' undeclared (first use this function) src/_tkagg.cpp:59: `TCL_ERROR' undeclared (first use this function) src/_tkagg.cpp:63: `photo' undeclared (first use this function) src/_tkagg.cpp:63: `Tk_FindPhoto' undeclared (first use this function) src/_tkagg.cpp:117: `block' undeclared (first use this function) src/_tkagg.cpp:143: `Tk_PhotoPutBlock' undeclared (first use this function) src/_tkagg.cpp:153: `Tk_PhotoBlank' undeclared (first use this function) src/_tkagg.cpp:158: `TCL_OK' undeclared (first use this function) src/_tkagg.cpp: In function `PyObject* _tkinit(PyObject*, PyObject*)': src/_tkagg.cpp:174: `Tcl_Interp' undeclared (first use this function) src/_tkagg.cpp:183: parse error before `)' token src/_tkagg.cpp:188: `struct TkappObject' has no member named `interp' src/_tkagg.cpp:194: `Tcl_CmdProc' undeclared (first use this function) src/_tkagg.cpp:194: parse error before `)' token C:/MinGW/include/c++/3.2.3/bits/basic_string.tcc: At top level: src/_tkagg.cpp:42: warning: `int PyAggImagePhoto(...)' defined but not used error: Command "g++ -O2 -Wall -Iwin32_static/include/tcl84 -I. -Isrc -Iswig -Iag g23/include -I. -I. -Iwin32_static/include/tcl84\freetype2 -I.\freetype2 -Isrc\f reetype2 -Iswig\freetype2 -Iagg23/include\freetype2 -I.\freetype2 -I.\freetype2 -IC:\Python24\lib\site-packages\numpy\core\include -IC:\Python24\include -IC:\Py thon24\PC -c src/_tkagg.cpp -o build\temp.win32-2.4\Release\src\_tkagg.o" failed with exit status 1 However, I have Tk installed, as it comes bundled with ActiveState python. -- Chris Fonnesbeck + Atlanta, GA + http://trichech.us - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Plotting Dates
I'm trying to plot dates using plot_date(), but the date for every point is labeled on the axis, and in a verbose format, resulting in a jumble of text making the date-axis completely unreadable. Is there any way to control the format of the dates displayed, and ensure only a small percentage of points are labeled on the axis? Chris - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plotting Dates
Thanks, that's exactly what I was looking for. Chris On 7/31/06, Richard Albright <[EMAIL PROTECTED]> wrote: > take a look at the finance_work2.py code on the screenshots page: > http://matplotlib.sourceforge.net/screenshots.html > > On Mon, 2006-07-31 at 11:52 -0400, Chris S wrote: > > I'm trying to plot dates using plot_date(), but the date for every > > point is labeled on the axis, and in a verbose format, resulting in a > > jumble of text making the date-axis completely unreadable. Is there > > any way to control the format of the dates displayed, and ensure only > > a small percentage of points are labeled on the axis? > > > > Chris > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share your > > opinions on IT & business topics through brief surveys -- and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- > Rick Albright > Senior Quantitvative Analyst > Indie Research, LLC > 254 Witherspoon Street > Princeton, NJ 08542 > (609)497-1030 > [EMAIL PROTECTED] > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plot_date + xdata & ydata must be same len
Hi, I am having trouble getting a variation of the tutorial plot_date() to work. I get the classic: RuntimeError: xdata and ydata must be the same length. The tutorial on the matplotlib site shows how to plot dates using whole days. I am plotting using multiple days showing each minute of the day. Before I run plot_date I setup to datetime vars and subtract them to get the timedelta so.. timedelta = enddate – startdate. I then use drange(startdate, enddate, timedelta) I pass this range into the plot_date function with my y axis data, which I have confirmed is numeric and the same number of entries as the number of datetimes I want to plot. Clearly I am incorrectly telling plotlib the intervals of time I want to plot. What is the best way to plot out an interday chart that has ticks for each min? Thanks - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot_date + xdata & ydata must be same len
Title: Re: [Matplotlib-users] plot_date + xdata & ydata must be same len Thanks, I actually got a work around now. Thanks for the follow. Chris Brinley ([EMAIL PROTECTED]) Orbitz - AA.com Operations Phone: 312-894-4787 Cell: 312-479-8193 Pager: 866-292-3508 -Original Message- From: John Hunter To: Brinley, Chris CC: matplotlib-users@lists.sourceforge.net Sent: Fri Sep 15 11:29:07 2006 Subject: Re: [Matplotlib-users] plot_date + xdata & ydata must be same len >>>>> "Brinley," == Brinley, Chris <[EMAIL PROTECTED]> writes: Chris> Hi, I am having trouble getting a variation of the Chris> tutorial plot_date() to work. I get the classic: Chris> RuntimeError: xdata and ydata must be the same length. Hmm, didn't know this had achieved classic status Chris> The tutorial on the matplotlib site shows how to plot Chris> dates using whole days. I am plotting using multiple Chris> days showing each minute of the day. Chris> Before I run plot_date I setup to datetime vars and Chris> subtract them to get the timedelta so.. timedelta = Chris> enddate - startdate. Chris> I then use drange(startdate, enddate, timedelta) This doesn't look right, since your delta equals the entire range. Usually you want your delta to be smaller. Chris> I pass this range into the plot_date function with my y Chris> axis data, which I have confirmed is numeric and the Chris> same number of entries as the number of datetimes I want Chris> to plot. Maybe you made a mistake here? It sometimes happens when working interactively that you add some bad data to a plot, realize your mistake, then add good data, but still see the error. When this happens, it is usually because your "hold" state is on and the previous data is still in your plot. You can clear the figure with fig.clf() If you are still having a problem, post a complete example that we can run. Chris> Clearly I am incorrectly telling plotlib the intervals Chris> of time I want to plot. What is the best way to plot out Chris> an interday chart that has ticks for each min? from matplotlib.dates import MinuteLocator ... # every minute ax.xaxis.set_major_locator(MinuteLocator()) # or every 5 minutes ax.xaxis.set_major_locator(MinuteLocator(nx.arange(0,61,5))) You'll probably also want to set the Formatter -- see the user's guide chapter on tick locating and formatting and also http://matplotlib.sf.net/matplotlib.ticker.html http://matplotlib.sf.net/matplotlib.dates.html and these examples mpl/examples> grep -l Locator *.py dashtick.py date_demo1.py date_demo2.py date_demo_convert.py date_demo_rrule.py finance_demo.py major_minor_demo1.py major_minor_demo2.py stock_demo.py - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Removing data from graph?
Hi, I'm trying to create an image on screen, and update it with new data. It works to have the data added, but my images keep showing the old data. I'm plotting sin(x) through the time, and every .5 seconds, I redraw the image. figure.hold(False) a = figure.add_subplot(111) t = arange(low,upper,0.01) s = sin(2*pi*t) a.plot(t,s) This is called first with low=0, upper=5, then with low=1, upper=6 etc. What I want is to see only 5 seconds, with the data moving off on the left side. However, what I see is that the old data is retained, and the sine is squeezed more and more. Does anyone know how to change this? Regards, Chris Niekel - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Compatible Version of Numpy?
I've spent the last 3 hours trying to install Matplotlib 0.87.6 on Windows, with no luck. The main problem I've run into is finding a compatible version of Numeric/Numarry/Numpy to use, and unfortanately the website doesn't mention this detail. I've tried installing numpy-1.0, 0.9.8, and 0.9.6, and I get some variation of the error below when I try to import matplotlib. What version of Numpy should Matplotlib work with? Regards, Chris Spencer RuntimeError: module compiled against version 102 of C-API but this version of numpy is 90709 The import of the numpy version of the _transforms module, _ns_transforms, failed. This is is either because numpy was unavailable when matplotlib was compiled, because a dependency of _ns_transforms could not be satisfied, or because the build flag for this module was turned off in setup.py. If it appears that _ns_transforms was not built, make sure you have a working copy of numpy and then re-install matplotlib. Otherwise, the following traceback gives more details: RuntimeError: module compiled against version 102 of C-API but this version of numpy is 90709 The import of the numpy version of the nxutils module, _nsnxutils, failed. This is is either because numpy was unavailable when matplotlib was compiled, because a dependency of _nsnxutils could not be satisfied, or because the build flag for this module was turned off in setup.py. If it appears that _nsnxutils was not built, make sure you have a working copy of numpy and then re-install matplotlib. Otherwise, the following traceback gives more details: E == ERROR: testXOGame (__main__.TestSequenceFunctions) -- Traceback (most recent call last): File "test_reasoning.py", line 38, in testXOGame frame.graph(all=True) File "z:\testing\poe\model\reasoning\reasoning.py", line 446, in graph import pylab as P File "C:\Program Files\Python24\Lib\site-packages\pylab.py", line 1, in ? from matplotlib.pylab import * File "C:\Program Files\Python24\Lib\site-packages\matplotlib\pylab.py", line 199, in ? import mlab #so I can override hist, psd, etc... File "C:\Program Files\Python24\Lib\site-packages\matplotlib\mlab.py", line 64, in ? import nxutils File "C:\Program Files\Python24\Lib\site-packages\matplotlib\nxutils.py", line 17, in ? from matplotlib._ns_nxutils import * ImportError: numpy.core.multiarray failed to import - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Compatible Version of Numpy?
> I think that 97.6 was compiled against 1.0rc2 but Charlie Moad is the > authority on this since he did the compile. I have added this "news > flash" to the site Ok, thanks. I suspected that, but since even Google isn't able to find an rc2 binary, I guess my only option is to wait for a compatible Matplotlib to be released. On a loosely-related topic, I originally tried upgrading to try out pylab.quiver. In earlier versions, the arrows drawn by quiver could not be properly scaled and were rendered at a huge size. Do you know if this was a registered bug, and if it's been fixed? Regards, Chris - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Is it possible to put a combo box on a matplotlib figure?
I have a matplotlib figure (by the way - matplot lib is brilliant) with lots of widgets (buttons, check boxes) on it, and am wondering if it is possible to put a combo box on it? Cheers, Chris Bartley - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Any fix for wxAgg on Mac?
Russell E Owen wrote: >> Russell E. Owen wrote: >>> On Feb 25 Samuel Smith reported that WXAgg crashed on MacOS X using >>> matplotlib 0.87. I just built matplotlib 0.87.7 on Python 2.5 and am >>> still having the problem. >>> - matplotlib 0.87.7 (from source) >> >> That may be the issue -- are you sure you compiled against the right >> wx? Apple delivered a version with OS-X 10.4, and it tends to get >> found when you compile. Search the archives here for how to get it to >> find the right one. > I used the wxPython binary installer from pythonmac.org. I assumed it > included a statically linked wx library but perhaps it does not. yes, it does (well, not exactly, but it does include it's own copies of the wx libs) > If not, > then I have no idea what wx it's using; I don't remember installing one > but I suppose I might have long ago. However, the issue is not which wx wxPython is using, but which wx matplotlib was built against. > I'm not sure this is relevant, but while building matplotlib I got > warnings about using the deprecated wxPython package instead of wx. yup, that's it all right. when mpl is building , it looks for a utility called wx-config, that tells it where to find the headers and libs it needs. The default wx-config on OS-X will point to the wrong wx, so you need to set a n environment variable or something pointing to the correct wx-config. Sorry I don't have the specific details right now, but it should be in the archives, or poke through setup.py and associated files for more info. I think I put a helpful warning in there at some point. good luck, -Chris I > had assumed the matplotlib folks were just a bit behind on their use of > wx, but maybe it is a clue as to what's wrong. > > -- Russell -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [matplotlib-devel] Calling to those "embedding" matplotlib in applications
On Mon, Aug 12, 2013 at 7:01 AM, Michael Droettboom wrote: > I propose to fix this by turning on interactive only when > running at an interactive console. I embed MPL more than other uses, and this sounds like a fine solution to me/ Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [matplotlib-devel] I have a Mac!
On Fri, Aug 23, 2013 at 8:14 AM, Matt Terry wrote: > I'm banging away at installing MPL on top of python.org's python. This is why binary installers are good idea! > the libfreetype/freetype issue. yeah, that's kind of uglyand where is doesn't "just work" for me... > 1) install libpng[1] and freetype[2] from source libpng and freetype are different, though install from source may be the way to go: libpng is there, but is not properly installed, I'm not sure it's got the header for the same version as the lib, and libpng-config is either not there or not for the right version or somethign ugly. It look, form messages at build time, that someone has hacked some code into the MPL build that figures all that out, but for other stuff I'm doing, I just punt and build libpng -- that's pretty straighforward, at least. But teh solution in the MPL code now seems to work. > 2) install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell's > directions[4]) so MPL finds XQuartz's libpng/freetype I _think_ that OS-X now ships with X11, which has freetype (though installed weirdly once again...) we certainly should NOT expect people to install anything big to build MPL, and binaries should not depend on anything not shipped by Apple by default. According to Russell, you do need to install something, so I think that's out. > 4) create the MPL binary installer and use that That's what most people should do -- but one of us needs to build it. > Option 1 seems simple-est, but installing freetype requires more than > ./configure && make && sudo make install. darn. But hopefully we can figure it out. > Option 4: This would require some input from whoever (Gohlke?, Owen?) makes > the binary installers. I think Russell has been doing it for MPL lately. My thoughts: We want to support two user-bases: 1) folks that don't mind a little command line work, and probably need other scientific libs, etc anyway, an want an MPL that runs on their machine: - these folks should use homebrew or macports to build the dependencies (or even hand-compile them). Ideally we have setup.py that will find those libs, and test to see that the builds work once in a while. 2) folks that "just want to use it" and/or want a binary they can re-distribute via py2app, etc. - for these folks, we need to provide binaries. These binaries should: 1) Match the python.org python builds. (probably only the Intel ones now...) 2) statically link the non-sytem libs This has been done for a while, off and on, most recently by Russell, AFAIK. But this is not a problem unique to MPL. All sorts of python packages need this, and only some of the package maintainers do it (well). Also, a bunch of packages require the same dependencies (i.e. PIL and MPL both need png and freetype) So, rather than re-inventing the wheel over and over again, It would be great to have a central repository where we can develop build scripts, etc that share an infrustructure for building these binaries. I've started one: https://github.com/MacPython/mac-builds there is not much there, only a couple things I'm working on at the moment (netCDF4, which is of interest to scipy folks, and py_gd, which is my own simple drawing lib, that no one else uses (yet?) If anyone wants to join the project let me know -- if I know you from your work with this community, I'll gladly add you. I'm using the gattai build system: (https://sourceforge.net/projects/gattai/). I decided to do that, as I was sick of re-writing essentially the same build scripts, and I kept adding features to mine that would have resulted in re-implementing gattai anyway. I've been hacking at gattai, and its author is quite open to moving it forward. That being said, there is no reason that we need to use the same build system -- we could easily have custom build scripts for a project, and still have it share the dependencies. I was planning on getting it all further along before announcing the project and looking for help, but since is came up... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov -- Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users