[Matplotlib-users] [Zoom function] bug in matplotlib ?
Hello, I'm using archlinux, with all up-to-date packages, and matplotlib within a python2 environment. When I use the zoom function, it seems the zoom is decreasing instead of increasing. Actually, the exact behaviour is to reproduce the old figure in the smaller area selected by the zoom function. That means the zoom behaviour is completely inverted. Does anyone here with a last version of matplotlib confirm the bug does still exist ? Here a snippet to test the zoom behaviour : $python2 code python from pylab import * plot( arange(0,pi,0.01) , sin(arange(0,pi,0.01)) ) show() /code greetings. David Kremer -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Zoom function] bug in matplotlib ?
Le mercredi 30 mars 2011 à 09:45 +0200, David Kremer a écrit : Hello, I'm using archlinux, with all up-to-date packages, and matplotlib within a python2 environment. When I use the zoom function, it seems the zoom is decreasing instead of increasing. Actually, the exact behaviour is to reproduce the old figure in the smaller area selected by the zoom function. That means the zoom behaviour is completely inverted. Does anyone here with a last version of matplotlib confirm the bug does still exist ? Are you aware of the «zoom out to rectangle» feature (with right click-n-drag, opposed to «zoom to rectangle» with left click-n-drag) ? http://matplotlib.sourceforge.net/users/navigation_toolbar.html -- Fabrice -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Zoom function] bug in matplotlib ?
Fabrice Silva [03/30/2011 01:13 PM]: Are you aware of the «zoom out to rectangle» feature (with right click-n-drag, opposed to «zoom to rectangle» with left click-n-drag) ? http://matplotlib.sourceforge.net/users/navigation_toolbar.html This is a nice feature that I acually wasn't aware of either! But speaking of zooming. How nice would it be to use the mouse wheel for that! Point at a position in the figure and just zoom in towards that point, keeping the (configurable) zoom factor constant for horizontal and vertical axes. To restrict the zoom to either horizontal *or* vertical axis one would simply hold 'x' or 'y', respectively, while using the mouse wheel. If I had a wish list, that item would be on top. :) Cheers, Joachim -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Zoom function] bug in matplotlib ?
Le mercredi 30 mars 2011 à 13:49 +0200, Joachim Saul a écrit : Fabrice Silva [03/30/2011 01:13 PM]: Are you aware of the «zoom out to rectangle» feature (with right click-n-drag, opposed to «zoom to rectangle» with left click-n-drag) ? http://matplotlib.sourceforge.net/users/navigation_toolbar.html This is a nice feature that I acually wasn't aware of either! But speaking of zooming. How nice would it be to use the mouse wheel for that! Point at a position in the figure and just zoom in towards that point, keeping the (configurable) zoom factor constant for horizontal and vertical axes. To restrict the zoom to either horizontal *or* vertical axis one would simply hold 'x' or 'y', respectively, while using the mouse wheel. If I had a wish list, that item would be on top. :) Look at what occurs when using the Pan button (the four-arrows button) and right-click (in combination with one of the w, y or CTRL keys) :) Documented on the same page. It uses drag on right click instead of mouse wheel. -- Fabrice -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot dict
On 03/30/2011 05:01 AM, Paul Ivanov wrote: Michael Droettboom, on 2011-03-29 10:12, wrote: On 03/29/2011 09:08 AM, xyz wrote: Hi, X and Y values are stored in a dict whereas X is the key and Y is the value in the following code: import matplotlib.pyplot as plt data = {4: 3, 5: 4, 6: 5, 7: 4, 8: 5} print data for i in sorted(data.keys()): print i How is possible to use plot with a dict in order to get a similar picture like this http://matplotlib.sourceforge.net/_images/invert_axes.png . In this case, you should be able to use: plt.plot(data.items()) For me, that line produces two lines with the abscissa going from 0 to 4. In other words, plt.plot(data.items()) ends up being equivalent to plt.plot(data.values());plt.plot(data.keys()) I think what xyz wants is this: x,y = zip(*sorted(data.items())) plt.plot(x,y) I think of the * in front of arguments to zip as being the pull tab or slider of the zipper (since it's at the top, you'll be pulling it down, or unzipping): see http://docs.python.org/library/functions.html#zip best, Thank you it works. -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Zoom function] bug in matplotlib ?
As far I'm concerned, I noticed indeed that the right click provide a dezoom, while left click provide a zoom. I was confused because gnuplot uses right click to zoom. But I'm glad to see that this post has treshed a big discussion on the topic ! Thanks :) -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [Zoom function] bug in matplotlib ?
Fabrice Silva [03/30/2011 02:30 PM]: Le mercredi 30 mars 2011 à 13:49 +0200, Joachim Saul a écrit : But speaking of zooming. How nice would it be to use the mouse wheel for that! Point at a position in the figure and just zoom in towards that point, keeping the (configurable) zoom factor constant for horizontal and vertical axes. To restrict the zoom to either horizontal *or* vertical axis one would simply hold 'x' or 'y', respectively, while using the mouse wheel. If I had a wish list, that item would be on top. :) Look at what occurs when using the Pan button (the four-arrows button) and right-click (in combination with one of the w, y or CTRL keys) :) Documented on the same page. Hey, that's cool! :) It uses drag on right click instead of mouse wheel. Yet it would be nice to have that function tied to the mouse wheel (like in Google maps, for instance) but that's not a complaint because the current behaviour is already very comfortable. Thanks for pointing that out! Cheers, Joachim -- Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Saving to PDF does not use alpha information for LineCollection?
Attached code for reproducing the problem python bug.py -- lc.pdf, lc.png I noticed a similar bug report posted some time ago on matplotlib-devel by Fernando Perez. http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg05133.html I am on 0.99.3. Has this been fixed in 1.0? I could not find any mention of it on the changelog ... Cheers, -- Giovanni L. Ciampaglia PhD Student University of Lugano, MACS Lab import matplotlib.pyplot as pp from matplotlib.collections import LineCollection from matplotlib.colors import colorConverter import numpy as np from numpy.random import normal a = 0.5 x = np.arange(100) Y = normal(size=(10,100)) coll = LineCollection([ np.c_[x,y] for y in Y ], colors=colorConverter.to_rgba_array('k', a)) pp.figure() ax = pp.gca() ax.add_collection(coll) pp.axis('tight') pp.draw() pp.savefig('lc.pdf', format='pdf') pp.savefig('lc.png', format='png') pp.show() -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Changing Image Size
How can you get the title to scale when the size is changed on the image? When I change the image size, my title is getting chopped off. Thank you Andrew -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Window appears, no graph drawn Fw: Plot show() errors, Mac OS 10.6
Please help. -Nate - Forwarded Message From: Nate Gallagher nate.gallag...@yahoo.com To: matplotlib-users@lists.sourceforge.net Sent: Mon, March 28, 2011 2:41:39 PM Subject: [Matplotlib-users] Plot show() errors, Mac OS 10.6 operating system $ uname -a Darwin nate-gallaghers-macbook-pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 matplotlib version: matplotlib-1.0.1-python.org-32bit-py2.7-macosx10.3.dmg obtained from: http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/ no o customizations to matplotlibrc $ python simple_plot.py --verbose-helpful $HOME=/Users/ibook CONFIGDIR=/Users/ibook/.matplotlib matplotlib data path /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data a loaded rc file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc c matplotlib version 1.0.1 verbose.level helpful interactive is False units is False platform is darwin Using fontManager instance from /Users/ibook/.matplotlib/fontList.cache backend TkAgg version 8.5 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium m to Bitstream Vera Sans (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.ttf) ) with score of 0.00 Exception in Tkinter callback Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py, , line 1410, in __call__ return self.func(*args) File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py, , line 245, in resize self.show() File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py, , line 249, in draw tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/tkagg.py, , line 19, in blit tk.call(PyAggImagePhoto, photoimage, id(aggimage), colormode, id(bbox_array)) TclError -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] cannot import name cbook
why? anyone knows? TemplateSyntaxError at /accounts/profile/ Caught ViewDoesNotExist while rendering: Could not import irrigaweb.pedotrans.views. Error was: cannot import name cbook Request Method:GETRequest URL: http://hirrigaweb.cpac.embrapa.br/accounts/profile/Django Version:1.2.5Exception Type:TemplateSyntaxErrorException Value: Caught ViewDoesNotExist while rendering: Could not import irrigaweb.pedotrans.views. Error was: cannot import name cbook Exception Location:/opt/python27/lib/python2.7/site-packages/django/core/urlresolvers.py in _get_callback, line 132Python Executable:/usr/bin/pythonPython Version: 2.7.1Python Path:['/opt/python27/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/opt/python27/lib/python2.7/site-packages/python_ldap-2.3.13-py2.7-linux-i686.egg', '/opt/python27/lib/python2.7/site-packages/lxml-2.3-py2.7-linux-i686.egg', '/opt/python27/lib/python2.7/site-packages/sorl_thumbnail-10.12.1-py2.7.egg', '/opt/python27/lib/python2.7/site-packages/stripogram-1.5-py2.7.egg', '/opt/python27/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-i686.egg', '/opt/python27/lib/python2.7/site-packages/urwid-0.9.9.1-py2.7-linux-i686.egg', '/opt/python27/lib/python27.zip', '/opt/python27/lib/python2.7', '/opt/python27/lib/python2.7/plat-linux2', '/opt/python27/lib/python2.7/lib-tk', '/opt/python27/lib/python2.7/lib-old', '/opt/python27/lib/python2.7/lib-dynload', '/opt/python27/lib/python2.7/site-packages', '/opt/python27/lib/python2.7/site-packages/PIL', '/var/www/cpac', '/var/www/cpac']Server time:Qua, 30 Mar 2011 12:17:38 -0500 Template error In template /var/www/cpac/irrigaweb/templates/cpac/base.html, error at line *46* Caught ViewDoesNotExist while rendering: Could not import irrigaweb.pedotrans.views. Error was: cannot import name cbook36 /td 37td width=45% class=copyright bUsuário: /b{{ usuarioAdmin }}/td 38 td width=45% class=copyright bEntrada: /b{{ data }}/td 39/tr 40 tr 41 td class=copyright bPerfil: /b{{ lotacaoCurriculo }}/td 42 td class=copyright spanbIP de acesso: /b{{ ip_addr_rem }}/span/td 43 /tr 44 td colspan=2 45 div align=center 46 a href=/ img src=/publico/imagens/btInicio.jpg alt=Menu //aa href={%url auth_logout%}?next=/img src=/publico/imagens/btSair.jpg alt=Sair //a 47 /div 48 /td 49 /tr 50 /table/td 51 /tr 52/table 53 /div 54/div -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plotting 3D scatter plots in matplotlib
I have a collection of Nx3 matrices in scipy/numpy and I'd like to make a 3 dimensional scatter of it, where the X and Y axes are determined by the values of first and second columns of the matrix, the height of each bar is the third column in the matrix, and the number of bars is determined by N. Each matrix represents a different data group and I want each to be plotted with a different color, and then set a legend for the entire figure. I have the following code: fig = pylab.figure() s = plt.subplot(1, 1, 1) colors = ['k', #B3C95A, 'b', '#63B8FF', 'g', #FF3300, 'r', 'k'] ax = Axes3D(fig) plots = [] index = 0 for data, curr_color in zip(datasets, colors): p = ax.scatter(log2(data[:, 0]), log2(data[:, 1]), log2(data[:, 2]), c=curr_color, label=my_labels[index]) s.legend() index += 1 plots.append(p) ax.set_zlim3d([-1, 9]) ax.set_ylim3d([-1, 9]) ax.set_xlim3d([-1, 9]) The issue is that ax.scatter plots things with a transparency and I'd like that remove. Also, I'd like to set the xticks and yticks and zticks -- how can I do that? Finally, the legend call does not appear, even though I am calling label= for each scatter call. How can I get the legend to appear? thanks very much for your help. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] applying colormap to a line
I wanted to display a line plot with rainbow coloring based on the y-value, similar to what's possible for surface plots. However, the 'plot' method does not appear to accept a 'cmap' argument. The closest thing I was able to find was a recipe for different colored line segments on the SciPy examples page (http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine), but that's not really what I want - I was hoping for a continuous gradient over hundreds (possibly thousands) of points on a line. Is this possible without too much hacking? thanks, Nat -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] applying colormap to a line
On 03/30/2011 01:32 PM, Nat Echols wrote: I wanted to display a line plot with rainbow coloring based on the y-value, similar to what's possible for surface plots. However, the 'plot' method does not appear to accept a 'cmap' argument. The closest thing I was able to find was a recipe for different colored line segments on the SciPy examples page (http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine), but that's not really what I want - I was hoping for a continuous gradient over hundreds (possibly thousands) of points on a line. Is this possible without too much hacking? I don't think there is anything better than the second example here: http://matplotlib.sourceforge.net/examples/pylab_examples/multicolored_line.html Eric thanks, Nat -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users