Re: [Matplotlib-users] Loading txt files
It works! Thank you very much! :) Dale Chayes wrote: Attached is a very simple version. It assumes your sample data is in a file. The first line is magic and makes significant assumptions about where python is installed on your system. This may or may not be the right answer for your system. Plotting requires matplotlib which you may need to install. #!/sw/bin/python import numpy import matplotlib.pyplot as plt dataset = numpy.genfromtxt(fname='readata.txt',skip_header=1) print dataset x=dataset[:,0] y=dataset[:,1] plt.figure(1) plt.plot(x,y) plt.plot(x,y,'ro') plt.show() -- On Nov 1, 2011, at 9:29 , yelena wrote: I have numpy. I need the body of a program, which plots y dependence of x. Maybe than I'll figure out how does it works... Daniel Hyams wrote: One quick way of doing this is to use numpy: import numpy dataset = numpy.genfromtxt(fname='yourfilename',skip_header=1) http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html On Tue, Nov 1, 2011 at 8:50 AM, yelena somebo...@inbox.lv wrote: Hi! I'm new at Matplotlib, so I need a little help. I was trying to load data from txt files with no luck. I have 2 collumns in txt files and I need to plot a XY graph. Should I modify txt file to other format? Can someone give me a simple example for doing this? In txt file could be such information: Meters Seconds 14 28 312 416 520 Thanks in advance! -- View this message in context: http://old.nabble.com/Loading-txt-files-tp32758393p32758393.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- RSAreg; Conference 2012 Save #36;700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Daniel Hyams dhy...@gmail.com -- RSAreg; Conference 2012 Save #36;700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://old.nabble.com/Loading-txt-files-tp32758393p32758620.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- RSAreg; Conference 2012 Save #36;700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSAreg; Conference 2012 Save #36;700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://old.nabble.com/Loading-txt-files-tp32758393p32765442.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Build MPL with VS 2008 problem
Hi, I am trying to build MPL 1.1.0 with VS 2008 on Windows XP 32. I have installed * Python 2.7.2 * Numpy 1.6 In the docs it says Windows users only need the first two (python and numpy) since the others are built into the matplotlib Windows installers available for download at the sourceforge site. OK, so I also downloaded matplotlib-1.1.0.win32-py2.7.exe and installed that. Now I cd to the matplotlib-1.1.0 directory and issue python setup.py build and get the following error. C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -Ic :\Python27\lib\site-packages\numpy\core\include -I. -Ic:\Python27\lib\site-packa ges\numpy\core\include\freetype2 -I.\freetype2 -Ic:\Python27\include -Ic:\Python 27\PC /Tpsrc/ft2font.cpp /Fobuild\temp.win32-2.7\Release\src/ft2font.obj ft2font.cpp C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc c:\cygwin\home\mads ipsen\matplotlib-1.1.0\src\ft2font.h(16) : fatal error C1083 : Cannot open include file: 'ft2build.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe' fa iled with exit status 2 Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Warning: converting a masked element to nan
matplotlib should handle both masked arrays and arrays with NaNs and treat both the same. Can you reduce the script to something that can be run independently without data? It's not clear to me yet why this is failing. Mike On 11/01/2011 05:24 PM, questions anon wrote: Hi All, I am trying to plot time against mean daily temperature values. The problem is temperature contains no data in a few areas. I want to be able to ignore this and continue plotting. When I run the below script on my data that has all normal numbers it works fine but when I run the script on my data that has sections of 'no data' I receive the below error and the graph will not plot the trendline. Any suggestions on how I could fix this. Thanks /Warning (from warnings module): File C:\Python27\lib\site-packages\numpy\ma\core.py, line 3785 warnings.warn(Warning: converting a masked element to nan.) UserWarning: Warning: converting a masked element to nan./ from netCDF4 import Dataset import matplotlib.pyplot as plt import numpy as N from mpl_toolkits.basemap import Basemap from netcdftime import utime from datetime import datetime import os from numpy import * import matplotlib.dates as mdates from numpy import ma as MA TSFCmeanall=[] timeall=[] time_intall=[] MainFolder=rE:/GriddedData/T_SFC/1987/ for (path, dirs, files) in os.walk(MainFolder): for dir in dirs: print dir path=path+'/' for ncfile in files: if ncfile[-3:]=='.nc': ncfile=os.path.join(path,ncfile) ncfile=Dataset(ncfile, 'r+', 'NETCDF4') TSFC=ncfile.variables['T_SFC'][0:20] TIME=ncfile.variables['time'][0:20] fillvalue=ncfile.variables['T_SFC']._FillValue TSFC=MA.masked_values(TSFC, fillvalue) ncfile.close() for TSFC, TIME in zip((TSFC[:]),(TIME[:])): cdftime=utime('seconds since 1970-01-01 00:00:00') ncfiletime=cdftime.num2date(TIME) timestr=str(ncfiletime) d = datetime.strptime(timestr, '%Y-%m-%d %H:%M:%S') date_string = d.strftime('%Y%m%d%H') time_int=int(date_string) TSFCmean=N.mean(TSFC) TSFCmeanall.append(TSFCmean) timeall.append(ncfiletime) time_intall.append(time_int) x=timeall y=TSFCmeanall x2=time_intall fig, ax=plt.subplots(1) z=N.polyfit(x2,y,1) p=N.poly1d(z) plt.plot(x,y) plt.plot(x,p(x2),'r--') #add trendline to plot fig.autofmt_xdate() ax.fmt_xdata=mdates.DateFormatter('%Y-%m-%d %H:%M:%S') plt.ylabel(Temperature C) plt.title(Mean Daily Temp) plt.show() -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 10:53 AM, Mads Ipsen wrote: Hi, I am trying to build MPL 1.1.0 with VS 2008 on Windows XP 32. I have installed * Python 2.7.2 * Numpy 1.6 In the docs it says Windows users only need the first two (python and numpy) since the others are built into the matplotlib Windows installers available for download at the sourceforge site. OK, so I also downloaded matplotlib-1.1.0.win32-py2.7.exe and installed that. Now I cd to the matplotlib-1.1.0 directory and issue python setup.py build and get the following error. C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -Ic :\Python27\lib\site-packages\numpy\core\include -I. -Ic:\Python27\lib\site-packa ges\numpy\core\include\freetype2 -I.\freetype2 -Ic:\Python27\include -Ic:\Python 27\PC /Tpsrc/ft2font.cpp /Fobuild\temp.win32-2.7\Release\src/ft2font.obj ft2font.cpp C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc c:\cygwin\home\mads ipsen\matplotlib-1.1.0\src\ft2font.h(16) : fatal error C1083 : Cannot open include file: 'ft2build.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe' fa iled with exit status 2 Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Warning: converting a masked element to nan
I have seen situations when using datetimes for the x axis where if all the data being viewed is masked (or nans, or whatever) then it errors out because the axis range can't be determined. Maybe that is what is happening here? Ben Root On Wed, Nov 2, 2011 at 11:48 AM, Michael Droettboom md...@stsci.edu wrote: matplotlib should handle both masked arrays and arrays with NaNs and treat both the same. Can you reduce the script to something that can be run independently without data? It's not clear to me yet why this is failing. Mike On 11/01/2011 05:24 PM, questions anon wrote: Hi All, I am trying to plot time against mean daily temperature values. The problem is temperature contains no data in a few areas. I want to be able to ignore this and continue plotting. When I run the below script on my data that has all normal numbers it works fine but when I run the script on my data that has sections of 'no data' I receive the below error and the graph will not plot the trendline. Any suggestions on how I could fix this. Thanks *Warning (from warnings module): File C:\Python27\lib\site-packages\numpy\ma\core.py, line 3785 warnings.warn(Warning: converting a masked element to nan.) UserWarning: Warning: converting a masked element to nan.* from netCDF4 import Dataset import matplotlib.pyplot as plt import numpy as N from mpl_toolkits.basemap import Basemap from netcdftime import utime from datetime import datetime import os from numpy import * import matplotlib.dates as mdates from numpy import ma as MA TSFCmeanall=[] timeall=[] time_intall=[] MainFolder=rE:/GriddedData/T_SFC/1987/ for (path, dirs, files) in os.walk(MainFolder): for dir in dirs: print dir path=path+'/' for ncfile in files: if ncfile[-3:]=='.nc': ncfile=os.path.join(path,ncfile) ncfile=Dataset(ncfile, 'r+', 'NETCDF4') TSFC=ncfile.variables['T_SFC'][0:20] TIME=ncfile.variables['time'][0:20] fillvalue=ncfile.variables['T_SFC']._FillValue TSFC=MA.masked_values(TSFC, fillvalue) ncfile.close() for TSFC, TIME in zip((TSFC[:]),(TIME[:])): cdftime=utime('seconds since 1970-01-01 00:00:00') ncfiletime=cdftime.num2date(TIME) timestr=str(ncfiletime) d = datetime.strptime(timestr, '%Y-%m-%d %H:%M:%S') date_string = d.strftime('%Y%m%d%H') time_int=int(date_string) TSFCmean=N.mean(TSFC) TSFCmeanall.append(TSFCmean) timeall.append(ncfiletime) time_intall.append(time_int) x=timeall y=TSFCmeanall x2=time_intall fig, ax=plt.subplots(1) z=N.polyfit(x2,y,1) p=N.poly1d(z) plt.plot(x,y) plt.plot(x,p(x2),'r--') #add trendline to plot fig.autofmt_xdate() ax.fmt_xdata=mdates.DateFormatter('%Y-%m-%d %H:%M:%S') plt.ylabel(Temperature C) plt.title(Mean Daily Temp) plt.show() -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33;http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] v1.1.0 crashes upon exit
Thanks Ben! I just updated my Macports and it brought in v1.1.0 so I will check it out for easier animation. In the meantime I notice that with MPL v1.1.0 the program crashes at the end a most of my old MPL example programs (I use the GTKAgg backend for all of them). A typical way to end the program is: gtk.main_quit() raise SystemExit and it crashes on the call the ''raise SystemExit. A typical output is /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/si te-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/si te-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() Any thoughts are appreciated! thanks again, john -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Scrolling plot and colorbar
Hello, I slightly modified the example show at http://www.scipy.org/Cookbook/Matplotlib/ScrollingPlot to plot image data. My version of the code is at: http://code.google.com/p/ccnworks/source/browse/trunk/various/scroll.py What is the correct way to add a colorbar to this plot? A simple plt.colorbar(axes) yields no colorbar drawn. Thanks. -- Gökhan -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] v1.1.0 crashes upon exit
Hi, On Wed, Nov 2, 2011 at 18:12, John Jameson jwin...@gmail.com wrote: In the meantime I notice that with MPL v1.1.0 the program crashes at the end a most of my old MPL example programs (I use the GTKAgg backend for all of them). A typical way to end the program is: gtk.main_quit() raise SystemExit and it crashes on the call the ''raise SystemExit. A typical output is /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() it happens also on Debian: $ python Python 2.7.2+ (default, Oct 5 2011, 10:41:47) [GCC 4.6.1] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.use('GTKAgg') from matplotlib import pyplot as plt plt.plot((1,2), (2,4)) [matplotlib.lines.Line2D object at 0x2f7e6d0] plt.show() /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552: GtkWarning: IA__gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552: GtkWarning: IA__gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() Segmentation fault Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Hi, I am trying to build MPL 1.1.0 with VS 2008 on Windows XP 32. I have installed * Python 2.7.2 * Numpy 1.6 In the docs it says Windows users only need the first two (python and numpy) since the others are built into the matplotlib Windows installers available for download at the sourceforge site. OK, so I also downloaded matplotlib-1.1.0.win32-py2.7.exe and installed that. Now I cd to the matplotlib-1.1.0 directory and issue python setup.py build and get the following error. C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W 3 /GS- /DNDEBUG -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -Ic :\Python27\lib\site-packages\numpy\core\include -I. -Ic:\Python27\lib\site-packa ges\numpy\core\include\freetype2 -I.\freetype2 -Ic:\Python27\include -Ic:\Python 27\PC /Tpsrc/ft2font.cpp /Fobuild\temp.win32-2.7\Release\src/ft2font.obj ft2font.cpp C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C 4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc c:\cygwin\home\mads ipsen\matplotlib-1.1.0\src\ft2font.h(16) : fatal error C1083 : Cannot open include file: 'ft2build.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe' fa iled with exit status 2 Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I need to built it from source. Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] v1.1.0 crashes upon exit
I'm not able to reproduce this, but I've seen similar issues in the past. Can you tell me if this patch fixes it for you? diff --git a/lib/matplotlib/backends/backend_gtk.py b/lib/matplotlib/backends/backend index 1012bbe..2efb72a 100644 --- a/lib/matplotlib/backends/backend_gtk.py +++ b/lib/matplotlib/backends/backend_gtk.py @@ -556,6 +556,10 @@ class FigureManagerGTK(FigureManagerBase): self.window.destroy() if hasattr(self, 'canvas'): self.canvas.destroy() +del self.toolbar +del self.vbox +del self.window +del self.canvas self.__dict__.clear() #Is this needed? Other backends don't have it. if Gcf.get_num_fig_managers()==0 and \ On 11/02/2011 01:23 PM, Sandro Tosi wrote: Hi, On Wed, Nov 2, 2011 at 18:12, John Jamesonjwin...@gmail.com wrote: In the meantime I notice that with MPL v1.1.0 the program crashes at the end a most of my old MPL example programs (I use the GTKAgg backend for all of them). A typical way to end the program is: gtk.main_quit() raise SystemExit and it crashes on the call the ''raise SystemExit. A typical output is /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() it happens also on Debian: $ python Python 2.7.2+ (default, Oct 5 2011, 10:41:47) [GCC 4.6.1] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.use('GTKAgg') from matplotlib import pyplot as plt plt.plot((1,2), (2,4)) [matplotlib.lines.Line2D object at 0x2f7e6d0] plt.show() /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552: GtkWarning: IA__gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552: GtkWarning: IA__gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() Segmentation fault Cheers, -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] v1.1.0 crashes upon exit
On Wed, Nov 2, 2011 at 20:39, Michael Droettboom md...@stsci.edu wrote: I'm not able to reproduce this, but I've seen similar issues in the past. Can you tell me if this patch fixes it for you? Nope, it doesn't. diff --git a/lib/matplotlib/backends/backend_gtk.py b/lib/matplotlib/backends/backend index 1012bbe..2efb72a 100644 --- a/lib/matplotlib/backends/backend_gtk.py +++ b/lib/matplotlib/backends/backend_gtk.py @@ -556,6 +556,10 @@ class FigureManagerGTK(FigureManagerBase): self.window.destroy() if hasattr(self, 'canvas'): self.canvas.destroy() + del self.toolbar + del self.vbox + del self.window + del self.canvas self.__dict__.clear() #Is this needed? Other backends don't have it. if Gcf.get_num_fig_managers()==0 and \ On 11/02/2011 01:23 PM, Sandro Tosi wrote: Hi, On Wed, Nov 2, 2011 at 18:12, John Jamesonjwin...@gmail.com wrote: In the meantime I notice that with MPL v1.1.0 the program crashes at the end a most of my old MPL example programs (I use the GTKAgg backend for all of them). A typical way to end the program is: gtk.main_quit() raise SystemExit and it crashes on the call the ''raise SystemExit. A typical output is /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() it happens also on Debian: $ python Python 2.7.2+ (default, Oct 5 2011, 10:41:47) [GCC 4.6.1] on linux2 Type help, copyright, credits or license for more information. import matplotlib matplotlib.use('GTKAgg') from matplotlib import pyplot as plt plt.plot((1,2), (2,4)) [matplotlib.lines.Line2D object at 0x2f7e6d0] plt.show() /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552: GtkWarning: IA__gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() /usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552: GtkWarning: IA__gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)' failed self.toolbar.destroy() Segmentation fault Cheers, -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] v1.1.0 crashes upon exit
On Wed, Nov 2, 2011 at 2:50 PM, Sandro Tosi mo...@debian.org wrote: On Wed, Nov 2, 2011 at 20:39, Michael Droettboom md...@stsci.edu wrote: I'm not able to reproduce this, but I've seen similar issues in the past. Can you tell me if this patch fixes it for you? Nope, it doesn't. Just yesterday, I started getting a crash-on-exit error for GTK. The only thing I changed was to update my system-wide packages, which I think included some updates for gtk-related things. Maybe something there broke something? Ben Root -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 08:43 PM, Michael Droettboom wrote: On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I can't seem to find this thread anywhere. It it really that difficult to build on Windows? It most be documented somewhere what the prereqs are? Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/2/2011 1:11 PM, Mads Ipsen wrote: On 11/02/2011 08:43 PM, Michael Droettboom wrote: On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net mailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I can't seem to find this thread anywhere. It it really that difficult to build on Windows? It most be documented somewhere what the prereqs are? See http://sourceforge.net/mailarchive/message.php?msg_id=27961105 and http://matplotlib.sourceforge.net/users/installing.html#build-requirements Prebuilt static link libraries for msvc compilers are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib. It seems you are trying to compile from within cygwin, using the include files provided by cygwin. That will probably not work. Christoph Best regards, Mads -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] v1.1.0 crashes upon exit
On Wed, Nov 2, 2011 at 21:00, Benjamin Root ben.r...@ou.edu wrote: On Wed, Nov 2, 2011 at 2:50 PM, Sandro Tosi mo...@debian.org wrote: On Wed, Nov 2, 2011 at 20:39, Michael Droettboom md...@stsci.edu wrote: I'm not able to reproduce this, but I've seen similar issues in the past. Can you tell me if this patch fixes it for you? Nope, it doesn't. Just yesterday, I started getting a crash-on-exit error for GTK. The only thing I changed was to update my system-wide packages, which I think included some updates for gtk-related things. Maybe something there broke something? Oh sure, it could be - I just wanted to state that also on Debian we have a similar problem than the one on Mac OS X, the tricky part is identify what that is :) Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
I had to do this sort of thing recently, but I did have to resort to some hackery to get it done (that I'm not proud of...I was in a bit of a hurry). Any corrections and or hand-slappings form the mpl-devs are, I'm sure, well deserved. AnywayI can only tell you what I did to get it working, but cannot vouch for the correctness of the procedure. I also cannot vouch for the correctness of my recollection :/ First, I downloaded a few dependencies. libpng, libfreetype, and zlib. Installed them all, which put them in c:\program files (x86)\gnuwin32. http://gnuwin32.sourceforge.net/packages/libpng.htm http://gnuwin32.sourceforge.net/packages/freetype.htm http://gnuwin32.sourceforge.net/packages/zlib.htm I might have had to download ActiveTcl and install that, too, for the tk back end. Now, you should have headers and libraries all in the gnuwin32 directory. Download matplotlib-1.1.0.tar.gz, and untar it somewhere. open a Visual C++ command prompt and navigate to the mpl directory. I assume that python is in your path, so now do the normal python setup.py configure (I know that configure doesn't exist, but it gives the printout to tell me what is found and what is not). python setup.py build python setup.py install It is likely during the build process that an include such as ft2font.h might not be found. I did not spend the time here to figure out how properly to point matplotlib to the ft2font.h include file (which is over in the gnuwin32/include dir), so I copied it to the mpl directory (top level). I think I ended up doing the same with png.h and pngconf.h. Then run python setup.py build again. Ugly, but it did work. At some point, I'll go figure out the proper procedure. On Wed, Nov 2, 2011 at 4:11 PM, Mads Ipsen madsip...@gmail.com wrote: On 11/02/2011 08:43 PM, Michael Droettboom wrote: On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I can't seem to find this thread anywhere. It it really that difficult to build on Windows? It most be documented somewhere what the prereqs are? Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Daniel Hyams dhy...@gmail.com -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 09:28 PM, Christoph Gohlke wrote: On 11/2/2011 1:11 PM, Mads Ipsen wrote: On 11/02/2011 08:43 PM, Michael Droettboom wrote: On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I can't seem to find this thread anywhere. It it really that difficult to build on Windows? It most be documented somewhere what the prereqs are? Seehttp://sourceforge.net/mailarchive/message.php?msg_id=27961105 and http://matplotlib.sourceforge.net/users/installing.html#build-requirements Prebuilt static link libraries for msvc compilers are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib. It seems you are trying to compile from within cygwin, using the include files provided by cygwin. That will probably not work. Christoph Best regards, Mads -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I am building from the VS2008 command prompt. But thanks for the info. Will have a look. Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] v1.1.0 crashes upon exit
On Wed, Nov 2, 2011 at 3:33 PM, Sandro Tosi mo...@debian.org wrote: On Wed, Nov 2, 2011 at 21:00, Benjamin Root ben.r...@ou.edu wrote: On Wed, Nov 2, 2011 at 2:50 PM, Sandro Tosi mo...@debian.org wrote: On Wed, Nov 2, 2011 at 20:39, Michael Droettboom md...@stsci.edu wrote: I'm not able to reproduce this, but I've seen similar issues in the past. Can you tell me if this patch fixes it for you? Nope, it doesn't. Just yesterday, I started getting a crash-on-exit error for GTK. The only thing I changed was to update my system-wide packages, which I think included some updates for gtk-related things. Maybe something there broke something? Oh sure, it could be - I just wanted to state that also on Debian we have a similar problem than the one on Mac OS X, the tricky part is identify what that is :) Cheers, Here is what got updated yesterday from my logs: Nov 01 09:37:29 Updated: gtk2-2.24.7-1.fc15.x86_64 Nov 01 09:37:32 Updated: initscripts-9.30.1-1.fc15.x86_64 Nov 01 09:37:33 Updated: sssd-client-1.5.14-3.fc15.x86_64 Nov 01 09:37:33 Updated: libipa_hbac-1.5.14-3.fc15.x86_64 Nov 01 09:37:54 Updated: selinux-policy-3.9.16-44.fc15.noarch Nov 01 09:38:22 Updated: selinux-policy-targeted-3.9.16-44.fc15.noarch Nov 01 09:38:24 Updated: sssd-1.5.14-3.fc15.x86_64 Nov 01 09:38:25 Updated: 1:microcode_ctl-1.17-19.fc15.x86_64 Nov 01 09:38:25 Updated: gtk2-immodule-xim-2.24.7-1.fc15.x86_64 Nov 01 09:38:27 Updated: gtk2-devel-2.24.7-1.fc15.x86_64 Nov 01 09:38:30 Updated: firefox-7.0.1-3.fc15.x86_64 Nov 01 09:38:32 Updated: gtk2-devel-docs-2.24.7-1.fc15.x86_64 Nov 01 09:38:33 Updated: gdb-7.3.1-45.fc15.x86_64 Nov 01 09:38:43 Updated: system-config-date-1.9.67-1.fc15.noarch Nov 01 09:38:44 Updated: gnome-shell-3.0.2-6.fc15.x86_64 Nov 01 09:38:45 Updated: latexmk-4.27a-1.fc15.noarch Nov 01 09:38:45 Updated: 1:obex-data-server-0.4.6-1.fc15.x86_64 So, I see gtk2-2.24.7-1, which looks like a bug-fix release. Maybe this is helpful? Ben Root -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/2/2011 1:39 PM, Mads Ipsen wrote: On 11/02/2011 09:28 PM, Christoph Gohlke wrote: On 11/2/2011 1:11 PM, Mads Ipsen wrote: On 11/02/2011 08:43 PM, Michael Droettboom wrote: On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net mailto:Matplotlib-users@lists.sourceforge.net mailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I can't seem to find this thread anywhere. It it really that difficult to build on Windows? It most be documented somewhere what the prereqs are? Seehttp://sourceforge.net/mailarchive/message.php?msg_id=27961105 and http://matplotlib.sourceforge.net/users/installing.html#build-requirements Prebuilt static link libraries for msvc compilers are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib. It seems you are trying to compile from within cygwin, using the include files provided by cygwin. That will probably not work. Christoph Best regards, Mads -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net mailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I am building from the VS2008 command prompt. But thanks for the info. Will have a look. Best regards, Mads OK. The cygwin in your home path looked suspicious: c:\cygwin\home\mads ipsen\ Christoph -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 09:46 PM, Christoph Gohlke wrote: On 11/2/2011 1:39 PM, Mads Ipsen wrote: On 11/02/2011 09:28 PM, Christoph Gohlke wrote: On 11/2/2011 1:11 PM, Mads Ipsen wrote: On 11/02/2011 08:43 PM, Michael Droettboom wrote: On 11/02/2011 01:34 PM, Mads Ipsen wrote: On 11/02/2011 05:50 PM, Michael Droettboom wrote: On 11/02/2011 10:53 AM, Mads Ipsen wrote: Any clues to why ft2build.h cannot be located. The above docs says it should be part of the binary installer. The binary for freetype is included with the installer, but the headers (needed to build, but not to run) are not. Do you need to build matplotlib from source, or just use it? Mike I need to built it from source. Mads In that case, you will need to install the development packages for freetype, libpng, libz, and numpy. I'm not a regular Windows user, so I don't know what the best practice is for that these days. Some of the other members on this list can hopefully jump in. There was also a thread on this list about Building on Windows from 08/18/2011 that might be helpful. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net mailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I can't seem to find this thread anywhere. It it really that difficult to build on Windows? It most be documented somewhere what the prereqs are? Seehttp://sourceforge.net/mailarchive/message.php?msg_id=27961105 and http://matplotlib.sourceforge.net/users/installing.html#build-requirements Prebuilt static link libraries for msvc compilers are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib. It seems you are trying to compile from within cygwin, using the include files provided by cygwin. That will probably not work. Christoph Best regards, Mads -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I am building from the VS2008 command prompt. But thanks for the info. Will have a look. Best regards, Mads OK. The cygwin in your home path looked suspicious: c:\cygwin\home\mads ipsen\ Christoph -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Works like a charm. What about support for the Qt backend. Do I need any Qt dev. env. installed or does it just rely on PyQt and Qt binaries being present on the machine? Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Warning: converting a masked element to nan
Thanks, I think you are right about the datetimes for the x axis causing the problem. Does anyone have any ideas how to resolve this? On Thu, Nov 3, 2011 at 4:11 AM, Benjamin Root ben.r...@ou.edu wrote: I have seen situations when using datetimes for the x axis where if all the data being viewed is masked (or nans, or whatever) then it errors out because the axis range can't be determined. Maybe that is what is happening here? Ben Root On Wed, Nov 2, 2011 at 11:48 AM, Michael Droettboom md...@stsci.eduwrote: matplotlib should handle both masked arrays and arrays with NaNs and treat both the same. Can you reduce the script to something that can be run independently without data? It's not clear to me yet why this is failing. Mike On 11/01/2011 05:24 PM, questions anon wrote: Hi All, I am trying to plot time against mean daily temperature values. The problem is temperature contains no data in a few areas. I want to be able to ignore this and continue plotting. When I run the below script on my data that has all normal numbers it works fine but when I run the script on my data that has sections of 'no data' I receive the below error and the graph will not plot the trendline. Any suggestions on how I could fix this. Thanks *Warning (from warnings module): File C:\Python27\lib\site-packages\numpy\ma\core.py, line 3785 warnings.warn(Warning: converting a masked element to nan.) UserWarning: Warning: converting a masked element to nan.* from netCDF4 import Dataset import matplotlib.pyplot as plt import numpy as N from mpl_toolkits.basemap import Basemap from netcdftime import utime from datetime import datetime import os from numpy import * import matplotlib.dates as mdates from numpy import ma as MA TSFCmeanall=[] timeall=[] time_intall=[] MainFolder=rE:/GriddedData/T_SFC/1987/ for (path, dirs, files) in os.walk(MainFolder): for dir in dirs: print dir path=path+'/' for ncfile in files: if ncfile[-3:]=='.nc': ncfile=os.path.join(path,ncfile) ncfile=Dataset(ncfile, 'r+', 'NETCDF4') TSFC=ncfile.variables['T_SFC'][0:20] TIME=ncfile.variables['time'][0:20] fillvalue=ncfile.variables['T_SFC']._FillValue TSFC=MA.masked_values(TSFC, fillvalue) ncfile.close() for TSFC, TIME in zip((TSFC[:]),(TIME[:])): cdftime=utime('seconds since 1970-01-01 00:00:00') ncfiletime=cdftime.num2date(TIME) timestr=str(ncfiletime) d = datetime.strptime(timestr, '%Y-%m-%d %H:%M:%S') date_string = d.strftime('%Y%m%d%H') time_int=int(date_string) TSFCmean=N.mean(TSFC) TSFCmeanall.append(TSFCmean) timeall.append(ncfiletime) time_intall.append(time_int) x=timeall y=TSFCmeanall x2=time_intall fig, ax=plt.subplots(1) z=N.polyfit(x2,y,1) p=N.poly1d(z) plt.plot(x,y) plt.plot(x,p(x2),'r--') #add trendline to plot fig.autofmt_xdate() ax.fmt_xdata=mdates.DateFormatter('%Y-%m-%d %H:%M:%S') plt.ylabel(Temperature C) plt.title(Mean Daily Temp) plt.show() -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33;http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing listMatplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSA#174; Conference 2012 Save $700 by Nov 18 Register now#33; http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- RSA(R) Conference 2012 Save $700 by Nov 18 Register
[Matplotlib-users] Unit testing code that generate matplotlib plots
Hi guys, Is there a common practice for unit testing code that creates matplotlib plots? I'm mainly just interested in code coverage versus correctness (making sure the code *works*) for now. I guess one way would be to disable the GUI backend so GUI elements don't get created (if the user is running the test suite from inside IPython in pylab mode, for example). Any tips or pointers to projects that do this would be very helpful. Thanks, Wes -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unit testing code that generate matplotlib plots
On Wed, Nov 2, 2011 at 4:16 PM, Wes McKinney wesmck...@gmail.com wrote: Hi guys, Is there a common practice for unit testing code that creates matplotlib plots? I'm mainly just interested in code coverage versus correctness (making sure the code *works*) for now. I guess one way would be to disable the GUI backend so GUI elements don't get created (if the user is running the test suite from inside IPython in pylab mode, for example). Any tips or pointers to projects that do this would be very helpful. We have a unit testing framework for comparing images against baseline images using PIL to compare approximately close at the rendering level. The code lives in matplotlib.testing and is triggered by matplotlib.test. It might be heavyweight for what you want, so if all you want to do is insure it runs just create some figures using the agg backend and call savefig. You can use the pyplot.switch_backends to switch backends if you are concerned about a user calling it from ipython in an interactive session. JDH JDH -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unit testing code that generate matplotlib plots
On Wed, Nov 2, 2011 at 5:20 PM, John Hunter jdh2...@gmail.com wrote: On Wed, Nov 2, 2011 at 4:16 PM, Wes McKinney wesmck...@gmail.com wrote: Hi guys, Is there a common practice for unit testing code that creates matplotlib plots? I'm mainly just interested in code coverage versus correctness (making sure the code *works*) for now. I guess one way would be to disable the GUI backend so GUI elements don't get created (if the user is running the test suite from inside IPython in pylab mode, for example). Any tips or pointers to projects that do this would be very helpful. We have a unit testing framework for comparing images against baseline images using PIL to compare approximately close at the rendering level. The code lives in matplotlib.testing and is triggered by matplotlib.test. It might be heavyweight for what you want, so if all you want to do is insure it runs just create some figures using the agg backend and call savefig. You can use the pyplot.switch_backends to switch backends if you are concerned about a user calling it from ipython in an interactive session. JDH JDH Cool, I think then just using switch_backends is what I want-- switch to Agg in setUpClass and switch back to whatever backend was in use before in tearDownClass. Will report back with any problems. thanks, Wes -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Unit testing code that generate matplotlib plots
On Wed, Nov 2, 2011 at 5:43 PM, Wes McKinney wesmck...@gmail.com wrote: On Wed, Nov 2, 2011 at 5:20 PM, John Hunter jdh2...@gmail.com wrote: On Wed, Nov 2, 2011 at 4:16 PM, Wes McKinney wesmck...@gmail.com wrote: Hi guys, Is there a common practice for unit testing code that creates matplotlib plots? I'm mainly just interested in code coverage versus correctness (making sure the code *works*) for now. I guess one way would be to disable the GUI backend so GUI elements don't get created (if the user is running the test suite from inside IPython in pylab mode, for example). Any tips or pointers to projects that do this would be very helpful. We have a unit testing framework for comparing images against baseline images using PIL to compare approximately close at the rendering level. The code lives in matplotlib.testing and is triggered by matplotlib.test. It might be heavyweight for what you want, so if all you want to do is insure it runs just create some figures using the agg backend and call savefig. You can use the pyplot.switch_backends to switch backends if you are concerned about a user calling it from ipython in an interactive session. JDH JDH Cool, I think then just using switch_backends is what I want-- switch to Agg in setUpClass and switch back to whatever backend was in use before in tearDownClass. Will report back with any problems. thanks, Wes switch_backends appears to have no effect on OS X / mpl 1.0.1. Has this been worked on in matplotlib 1.1.0? I can always just skip MPL unit tests if the user if IPython is running and call mpl.use('Agg') otherwise. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build MPL with VS 2008 problem
On 11/02/2011 05:09 PM, Mads Ipsen wrote: Works like a charm. What about support for the Qt backend. Do I need any Qt dev. env. installed or does it just rely on PyQt and Qt binaries being present on the machine? Just PyQt and Qt binaries should be enough -- there is no C/C++ code in matplotlib that needs to link to Qt directly. Mike -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Scrolling plot and colorbar
A self response: self.fig.colorbar(self.plot_data) does the trick. On Wed, Nov 2, 2011 at 11:14 AM, Gökhan Sever gokhanse...@gmail.com wrote: Hello, I slightly modified the example show at http://www.scipy.org/Cookbook/Matplotlib/ScrollingPlot to plot image data. My version of the code is at: http://code.google.com/p/ccnworks/source/browse/trunk/various/scroll.py What is the correct way to add a colorbar to this plot? A simple plt.colorbar(axes) yields no colorbar drawn. Thanks. -- Gökhan -- Gökhan -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] PyPI has version 1.0.1
Hi, I just noticed that PyPI lists matplotlib 1.0.1 as the latest version, so pip and easy_install install version 1.0.1 instead of version 1.1.0. Can somebody update the listing at the PyPI site? Thanks, Scott -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PyPI has version 1.0.1
On Wednesday, November 2, 2011, Scott Lasley slas...@space.umd.edu wrote: Hi, I just noticed that PyPI lists matplotlib 1.0.1 as the latest version, so pip and easy_install install version 1.0.1 instead of version 1.1.0. Can somebody update the listing at the PyPI site? Thanks, Scott And if somebody knows how, let me know so I can add it to the notes for the developer section? Ben Root -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PyPI has version 1.0.1
On Wed, Nov 2, 2011 at 10:02 PM, Benjamin Root ben.r...@ou.edu wrote: I just noticed that PyPI lists matplotlib 1.0.1 as the latest version, so pip and easy_install install version 1.0.1 instead of version 1.1.0. Can somebody update the listing at the PyPI site? Thanks, Scott And if somebody knows how, let me know so I can add it to the notes for the developer section? I updated pypi, so please let us know if there are any more problems -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] PyPI has version 1.0.1
On Wednesday, November 2, 2011, John Hunter jdh2...@gmail.com wrote: On Wed, Nov 2, 2011 at 10:02 PM, Benjamin Root ben.r...@ou.edu wrote: I just noticed that PyPI lists matplotlib 1.0.1 as the latest version, so pip and easy_install install version 1.0.1 instead of version 1.1.0. Can somebody update the listing at the PyPI site? Thanks, Scott And if somebody knows how, let me know so I can add it to the notes for the developer section? I updated pypi, so please let us know if there are any more problems So the instruction should be to remind John Hunter to update the entry in PyPi? Got it. Ben Root -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users