Re: [Matplotlib-users] filled step plot?
Hi, Le 27/01/2013 00:35, Skipper Seabold a écrit : This has been asked before, and I just filed a ticket [1]. Can anyone think of a better way to do something like this? The fill_between below is pretty suboptimal IMO. I feel that adding a filled step plot would indeed be useful. Just thinking at a possible API, would it make sense to add the drawstyle argument which already exists for plot() to fill_between() ? best, Pierre signature.asc Description: OpenPGP digital signature -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Problems installing matplotlib - compiling error
Hi guy, as I'm new to matplotlib I tried to install it following the instructions on http://matplotlib.org/faq/installing_faq.html#source-install-from-git http://matplotlib.org/faq/installing_faq.html#source-install-from-git . After downloading and changing the directory properly I get the following error: building 'matplotlib.ft2font' extension gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -DPYCXX_PYTHON_2TO3=1 -I/usr/local/include -I/usr/include -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/include/python3.2mu -c src/ft2font.cpp -o build/temp.linux-x86_64-3.2/src/ft2font.o In file included from ./CXX/Extensions.hxx:37:0, from src/ft2font.h:6, from src/ft2font.cpp:3: ./CXX/WrapPython.h:58:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 I'm using Linux Mint Nadia 14.2 Kernel 3.5.0.17, Python 3.2.3 (Oct 19 2012) and gcc 4.7.2. Numpy, Simpy Scipy are up to date. What did I do wrong? I have to use python3 because every other task was written specifficly with python3. cheers, Christian -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-installing-matplotlib-compiling-error-tp40343.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems installing matplotlib - compiling error
On Mon, Jan 28, 2013 at 10:20 AM, Orgun ambr...@gmail.com wrote: Hi guy, as I'm new to matplotlib I tried to install it following the instructions on http://matplotlib.org/faq/installing_faq.html#source-install-from-git http://matplotlib.org/faq/installing_faq.html#source-install-from-git . After downloading and changing the directory properly I get the following error: building 'matplotlib.ft2font' extension gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -DPYCXX_PYTHON_2TO3=1 -I/usr/local/include -I/usr/include -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/include/python3.2mu -c src/ft2font.cpp -o build/temp.linux-x86_64-3.2/src/ft2font.o In file included from ./CXX/Extensions.hxx:37:0, from src/ft2font.h:6, from src/ft2font.cpp:3: ./CXX/WrapPython.h:58:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 This error leads me to think that you need the Python3 development headers. $ sudo apt-get install python3-dev # from memory, so yeah Let us know if that works. -p I'm using Linux Mint Nadia 14.2 Kernel 3.5.0.17, Python 3.2.3 (Oct 19 2012) and gcc 4.7.2. Numpy, Simpy Scipy are up to date. What did I do wrong? I have to use python3 because every other task was written specifficly with python3. cheers, Christian -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems installing matplotlib - compiling error
Thanks, that helped a lot! I don't know why the dev-package hasn't been installed. That has been the first think I thought I did when re-installing after my latest hardware change in December. Thanks a lot. That saved my day. Christian -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-installing-matplotlib-compiling-error-tp40343p40345.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems installing matplotlib - compiling error
As a shortcut, you can also install all of the build dependencies for a package (without installing the package itself) using: sudo apt-get build_dep python-matplotlib Mike On 01/28/2013 01:40 PM, Orgun wrote: Thanks, that helped a lot! I don't know why the dev-package hasn't been installed. That has been the first think I thought I did when re-installing after my latest hardware change in December. Thanks a lot. That saved my day. Christian -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-installing-matplotlib-compiling-error-tp40343p40345.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems installing matplotlib - compiling error
On Mon, Jan 28, 2013 at 9:05 PM, Michael Droettboom md...@stsci.edu wrote: sudo apt-get build_dep python-matplotlib small typo fix: the option name is 'build-dep'. Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems installing matplotlib - compiling error
Hi, yeah, during my system re-install I used the built-dep option but maybe I was to busy to notice that I forgot the p3-dev's. Now everything is running fine and the last two hours were enlighting. Christian -- A little learning never caused anyone's head to explode. No trees were killed in sending this message. However, a large number of electrons were seriously inconvenienced. On Mon, Jan 28, 2013 at 9:20 PM, Sandro Tosi [via matplotlib] ml-node+s1069221n40347...@n5.nabble.com wrote: On Mon, Jan 28, 2013 at 9:05 PM, Michael Droettboom [hidden email]http://user/SendEmail.jtp?type=nodenode=40347i=0 wrote: sudo apt-get build_dep python-matplotlib small typo fix: the option name is 'build-dep'. Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ Matplotlib-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=40347i=1 https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- If you reply to this email, your message will be added to the discussion below: http://matplotlib.1069221.n5.nabble.com/Problems-installing-matplotlib-compiling-error-tp40343p40347.html To unsubscribe from Problems installing matplotlib - compiling error, click herehttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=40343code=YW1icm9zY0BnbWFpbC5jb218NDAzNDN8LTExNDczMTA5Njg= . NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-installing-matplotlib-compiling-error-tp40343p40348.html Sent from the matplotlib - users mailing list archive at Nabble.com.-- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Baseline of TeX fonts
I guess you have text.usetex=True? In this case, the baselines are not correct unless you also set text.latex.preview as True. For example, try to add following line in your rc file. text.latex.preview : True (You also need preview.sty installed) If this does not solve the problem, please post a screenshot that demonstrating the problem with your rc file. Regards, -JJ On Sun, Jan 20, 2013 at 5:24 PM, Magician f_magic...@mac.com wrote: Hi all, I'm using matplotlib 1.1.0 for Python27 on Windows 7. I'd like to apply TeX fonts at legends and labels. But if I try to do, the texts' baselines become upper, and the layouts get out of shapes. For example, I set legend titles as below: - 'Plot 1' - r'Plot 2 ($\alpha$)' -'Plot 3' then only the second one was raised. Both Computer Modern and \mathdefault fonts have same issues. I want to fix all the baselines as default positions. Does anyone have good ideas? Magician -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Subaxes deletion issue
The divider thing from axes_grid toolkit is primarily designed for a static layout. So, it may become quite tricky when you want to adjust the layout dynamically. Here is a modified version your code that I think does what you want. from matplotlib.figure import Figure from mpl_toolkits.axes_grid.axes_divider import make_axes_locatable from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class Test(QWidget): def __init__(self): QWidget.__init__(self) self.resize(1000, 600) self.fig = Figure(figsize=(100,100), dpi=75) axes1 = self.fig.add_subplot(121) axes2 = self.fig.add_subplot(122) self.subaxes = [] self.main_axes = [axes1, axes2] self.locators_orig = [] for ax in [axes1, axes2]: make_axes_locatable(ax) self.locators_orig.append(ax.get_axes_locator()) self.divider = make_axes_locatable(ax) self.subaxes.append(self.divider.append_axes(right, 40%, 20%)) b = QPushButton(Remove subaxes) b.clicked.connect(self.OnBtnClicked) l = QHBoxLayout() l.addWidget(FigureCanvas(self.fig)) l.addWidget(b) self.setLayout(l) def OnBtnClicked(self): for sa in self.subaxes: self.fig.delaxes(sa) del sa for ax, locator in zip(self.main_axes, self.locators_orig): ax.set_axes_locator(locator) self.fig.canvas.draw() app = QApplication(sys.argv) win = Test() win.show() sys.exit(app.exec_()) IHTH, -JJ On Fri, Jan 18, 2013 at 6:57 AM, gad massi_...@msn.com wrote: Hi everyone, I'm getting in trouble trying to delete a couple of subaxes from my canvas. The problem is shown by the example script below: from matplotlib.figure import Figure from mpl_toolkits.axes_grid.axes_divider import make_axes_locatable from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class Test(QWidget): def __init__(self): QWidget.__init__(self) self.resize(1000, 600) self.fig = Figure(figsize=(100,100), dpi=75) axes1 = self.fig.add_subplot(121) axes2 = self.fig.add_subplot(122) self.subaxes = [] for ax in [axes1, axes2]: self.divider = make_axes_locatable(ax) self.subaxes.append(self.divider.append_axes(right, 40%, 20%)) b = QPushButton(Remove subaxes) b.clicked.connect(self.OnBtnClicked) l = QHBoxLayout() l.addWidget(FigureCanvas(self.fig)) l.addWidget(b) self.setLayout(l) def OnBtnClicked(self): for sa in self.subaxes: self.fig.delaxes(sa) del sa self.fig.canvas.draw() app = QApplication(sys.argv) win = Test() win.show() sys.exit(app.exec_()) The main window is made up of two main axes an two subaxes placed on their right side. If you click the button in the window, the two subaxes disappear as I expect, but the orignal axes don't resize. Is there something I am missing? Or can anyone point me out if there is a better way to achieve this? Thanks in advance! -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Subaxes-deletion-issue-tp40268.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Plot trajectories on an map using matplotlib-basemap
#! /usr/bin/python import numpy as np data = np.loadtxt('path-tracks.csv',dtype=np.str,delimiter=',',skiprows=1) print data [['19.70' '-95.20' '2/5/04 6:45 AM' '1' '-38' 'CCM'] ['19.70' '-94.70' '2/5/04 7:45 AM' '1' '-48' 'CCM'] ['19.30' '-93.90' '2/5/04 8:45 AM' '1' '-60' 'CCM'] ['19.00' '-93.50' '2/5/04 9:45 AM' '1' '-58' 'CCM'] ['19.00' '-92.80' '2/5/04 10:45 AM' '1' '-50' 'CCM'] ['19.20' '-92.60' '2/5/04 11:45 AM' '1' '-40' 'CCM'] ['19.90' '-93.00' '2/5/04 12:45 PM' '1' '-43' 'CCM'] ['20.00' '-92.80' '2/5/04 1:15 PM' '1' '-32' 'CCM'] ['23.10' '-100.20' '30/5/04 4:45 AM' '2' '-45' 'SCME'] ['23.20' '-100.00' '30/5/04 5:45 AM' '2' '-56' 'SCME'] ['23.30' '-100.00' '30/5/04 6:45 AM' '2' '-48' 'SCME'] ['23.30' '-100.20' '30/5/04 7:45 AM' '2' '-32' 'SCME'] ['23.40' '-99.00' '31/5/04 3:15 AM' '3' '-36' 'SCM'] ['23.50' '-98.90' '31/5/04 4:15 AM' '3' '-46' 'SCM'] ['23.60' '-98.70' '31/5/04 5:15 AM' '3' '-68' 'SCM'] ['23.70' '-98.80' '31/5/04 6:15 AM' '3' '-30' 'SCM']] with the above code I get an array whose columns represent: [Lat, Lon, Date, Identifier, Temperatures, Category]. Now, I will put a code that allows me to plot the first and second column on the map of Mexico: #!/usr/bin/python #Project Storm: Plot trajectories of convective systems #import libraries import numpy as np from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as pl # Plot a map for Mexico m = Basemap(projection='cyl', llcrnrlat=12, urcrnrlat=35,llcrnrlon=-120, urcrnrlon=-80, resolution='c', area_thresh=1000.) m.bluemarble() m.drawcoastlines(linewidth=0.5) m.drawcountries(linewidth=0.5) m.drawstates(linewidth=0.5) #Draw parallels and meridians m.drawparallels(np.arange(10.,35.,5.)) m.drawmeridians(np.arange(-120.,-80.,10.)) m.drawmapboundary(fill_color='aqua') #Open file whit numpy data = np.loadtxt('path-tracks.csv', dtype=np.str,delimiter=' , ', skiprows=1) latitude = data[:,0] longitude = data[:,1] #Convert latitude and longitude to coordinates X and Y x, y = m(longitude, latitude) #Plot the points on the map pl.plot(x,y,'ro-') pl.show() The points plotted on the map, corresponding to three different paths with a line connecting all points. Mi final idea is to draw a line connecting the points associated with each path, How I can do this? or How should I structure my data to plot the different paths? is posible draw an identifier or a mark for each path? how I can set the size of the figure so that it can distinguish the separation between the points? -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users