Re: [Matplotlib-users] Draggable matplotlib legend
Good job! +1 On Fri, Jan 29, 2010 at 4:14 AM, Fernando Perez fperez@gmail.comwrote: On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker chris.bar...@noaa.gov wrote: Might I suggest that that be made: leg.draggable(True) leg.draggable(False) Agreed. My favorite api for toggles is: _state = True def toggle(state=None): global _state old = _state if state is None: _state = not _state else: _state = state return old ### This lets you: - toggle without arguments - set state specifically as needed - save previous state before setting it if you need to make temporary changes. Cheers, f -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Draggable matplotlib legend
On Thu, Jan 28, 2010 at 10:14 PM, Fernando Perez fperez@gmail.com wrote: On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker chris.bar...@noaa.gov wrote: Might I suggest that that be made: leg.draggable(True) leg.draggable(False) Agreed. My favorite api for toggles is: _state = True OK, this is committed. Thanks for the suggestion. JDH -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Error with 0.99.2 when using Intel Compiler (Linux)
Hi, It seems that the compilation of base_format needs a C++ compiler, but distutils launches icc instead of icpc. This may work with gcc, but with Intel Compiler, I can't force icc to understand C++. I don't know what happened between 0.98.5 and 0.99.2, but I can't use Matplotlib anymore :| Matthieu -- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Using matshow to efficiently show seqeuences of images
Hello, I'm using matshow to display a sequence of images in a QT window; i.e each time a key is pressed a new image is displayed. The performance seems somewhat sluggish (my baseline here is displaying the images using opencv). So I'm wondering if there are some well established methods for using matshow efficiently that I'm missing. Currently, I'm clearing the figure in between each call to matshow. Does this lead to expensive deallocation and reallocation of memory which could potentially be avoided by simply changing the values stored in memory? Thanks Jeremy Lewi Engineering Scientist The Intellisis Corporation jl...@intellisis.com -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] markers in linestyles
Hi there, the linestyle mechanism of on-off inks is pretty flexible but still limited to dash dot combinations. It would be a nice feature if you could simply use a marker inside a linestyle instead of a dot for example. This would decouple vertices and markers and add a completely new dimension to linestyles. I have highly resolved, unregularly spaced data which look rather ugly using markers or skipped markers at vertices. Evaluating the complexity to implement this feature I got lost in the code when it comes down to the backend stuff. Which object actually calculates the arc lengths to draw the linestyles? Could that feature be feasible in MPL? Thanks, Felix -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Label picker broken?
Picking text outside of the axes region seems to be broken in matplotlib 0.99.1 and in the latest SVN. This functionality used to work in version 0.98.3. The example code pick_event_demo.py demonstrates the issue. The ylabel in the red box is no longer pickable. Is there a clip_on or similar setting on the picker that needs to be set now? Below is a simplified version of pick_event_demo.py for reference. I also added some text to the plot to make sure that text inside the axes region was still pickable. Thanks, -Ben #!/usr/bin/env python # simplified example code: pick_event_demo.py from matplotlib.pyplot import figure, show from matplotlib.lines import Line2D from matplotlib.patches import Patch, Rectangle from matplotlib.text import Text from matplotlib.image import AxesImage import numpy as npy from numpy.random import rand fig = figure() ax1 = fig.add_subplot(111) ax1.set_title('click on points, rectangles or text', picker=True) ax1.set_ylabel('ylabel', picker=True, bbox=dict(facecolor='red')) ax1.text(50, 0.5, pick me, picker=True) line, = ax1.plot(rand(100), 'o', picker=5) # 5 points tolerance def onpick1(event): if isinstance(event.artist, Line2D): thisline = event.artist xdata = thisline.get_xdata() ydata = thisline.get_ydata() ind = event.ind print 'onpick1 line:', zip(npy.take(xdata, ind), npy.take(ydata, ind)) elif isinstance(event.artist, Rectangle): patch = event.artist print 'onpick1 patch:', patch.get_path() elif isinstance(event.artist, Text): text = event.artist print 'onpick1 text:', text.get_text() fig.canvas.mpl_connect('pick_event', onpick1) show() #end code Ben Axelrod Robotics Engineer (800) 641-2676 x737 [cid:109365016@29012010-0A93] www.coroware.comhttp://www.coroware.com/ www.corobot.nethttp://www.corobot.net/ inline: image002.gif-- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Draggable matplotlib legend
I did some refactoring and now the annotation is also draggable.. I also added an example, examples/animation/draggable_legend.py Regards, -JJ On Fri, Jan 29, 2010 at 10:28 AM, John Hunter jdh2...@gmail.com wrote: On Thu, Jan 28, 2010 at 10:14 PM, Fernando Perez fperez@gmail.com wrote: On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker chris.bar...@noaa.gov wrote: Might I suggest that that be made: leg.draggable(True) leg.draggable(False) Agreed. My favorite api for toggles is: _state = True OK, this is committed. Thanks for the suggestion. JDH -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Draggable matplotlib legend
One minor issue with the example is once you drag one of the items (legend or text or image) out of the plotting area there is no way to move them back unless you restart the example. Do you get the same defect? On Fri, Jan 29, 2010 at 11:40 AM, Jae-Joon Lee lee.j.j...@gmail.com wrote: I did some refactoring and now the annotation is also draggable.. I also added an example, examples/animation/draggable_legend.py Regards, -JJ On Fri, Jan 29, 2010 at 10:28 AM, John Hunter jdh2...@gmail.com wrote: On Thu, Jan 28, 2010 at 10:14 PM, Fernando Perez fperez@gmail.com wrote: On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker chris.bar...@noaa.gov wrote: Might I suggest that that be made: leg.draggable(True) leg.draggable(False) Agreed. My favorite api for toggles is: _state = True OK, this is committed. Thanks for the suggestion. JDH -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] AXES properties
Hello, I am creating a plot with multiple y-axis (up to 6) and twinx works pretty well. The problem is that there are too much wasted spaces used up by the axes. Since I have multiple axes, it cuts into the amount of space available for the plot area. I need to know how I can squeeze some spaces out of the standard axes. First thing I discovered was that I can rotate the tick labels to vertical by: plt.setp(ax.major_ticklabels, rotation=vertical) where ax is my y-axis. But then: (1) How to reduce the space between the tick and the axes label? First I tried to place the label on top but couldn't get that to work. Then I tried to change the position property of the axis label object and that have no effect. So, can somebody please tell me how I can do these 2 things? (2) How to avoid overlapping tick labels? With the way the standard x and y axis are drawn, after I do a vertical rotate of the y tick labels, the first y tick label overlaps with the last x tick label since they are both center aligned. Is there any way to change the alignment of only the first and last tick labels of an axes (while keeping the rest center aligned)? Thanks, -- John Henry -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Assigning k key for xscaling
My initial patch is ready for your review. I tested with latest svn and customized key-mapping (from matplotlibrc) is working correctly. Please review, and let me know if there would be any better solution, variable naming, placing etc.. I can also update the http://matplotlib.sourceforge.net/users/navigation_toolbar.html accordingly. On Mon, Jan 25, 2010 at 12:58 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello, I could these keys into rcsetup.py file as well as matplotlibrc.template and update backend_bases.py accordingly. And add some documentation reflecting the changes made. # Event keys to interact with figures/plots via keyboard fullscreen : 'f' home : 'h' reset : 'r' back : 'c' forward : 'v' pan : 'p' zoom : 'o' save : 's' grid : 'g' yscale : 'l' xscale : 'k' *Notes:* Matthias, leaving values as empty will remove the key short-cut. Don't understand exactly what 'a' does? f doesn't toggle full-screen --using qt4agg backend. There are a couple function duplicates. (eg. back with 'c' and left and backspace keys. How can represent them? Create a list inside the dictionary? back = ['c', 'left', 'backspace'] 'o' seems like unnecessary. Since you have to select an area using mouse. 's' doesn't behave correctly here. Shouldn't it bring the save dialog? Instead I am getting: TypeError: save_figure() takes exactly 1 argument (2 given) On Mon, Jan 25, 2010 at 8:32 AM, Matthias Michler matthiasmich...@gmx.net wrote: Hi Gökhan, I just wanted to discuss the key, because I think this patch should be part of matplotlib and not only of individual users. I think it is worth be be added to the mpl-tracker at http://sourceforge.net/tracker/?group_id=80706 or maybe one of the developers has the time to commit this small change? I think your idea about key-mappings in the matplotlib-rc is a good option to customize keyboard short cuts and even remove short-cuts which aren't of intrest for the individual user. Furthermore the latter yields space for keyboard shortcuts, which are used in one's own program. Kind regards, Matthias On Friday 22 January 2010 16:57:22 Gökhan Sever wrote: It is very simple to change key-assignment. Take a look at the backend_bases.py code (search for event.key instances) : elif event.key == 'L': I was thinking to move y-scaling to y and x-scaling to x but x and y are assigned to something else ( http://matplotlib.sourceforge.net/users/navigation_toolbar.html) For me toggling k is simpler for me than doing Shift-L. Maybe these options could be provided in the matplotlibrc file. Users can make their key mapping based on their choice. That requires some more coding :) On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler matthiasmich...@gmx.netwrote: Hi Gökhan, Hi list members, This is really a missing feature in matplotlib in my opinion and it's great that you took the time to make an suggestion, but I would prefer capital L for the xaxis-scaling like gnuplot although I'm not sure this is possible. What do you and other list members think about that? Kind regards, Matthias On Thursday 21 January 2010 19:45:37 Gökhan Sever wrote: Hello, l key does the log - linear scaling for y-axis. I have made a minor change to use k for x-axis scaling. Patch added. Feel free to add if you find it useful. -- Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Gökhan -- Gökhan keymap.patch Description: Binary data -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Problem using TeX
Hello, I try to use LaTeX in my plot. I follow the instructions from http://www.scipy.org/Cookbook/Matplotlib/UsingTex flor...@horus:~ cat .matplotlib/matplotlibrc text.usetex: true My plotting code looks like: Ma = arange(1.0, 5.0, 0.01) Ts = [T(i) for i in Ma] # BTW: Is there a way to spare this line? plot(Ma, Ts, label=r'/frac{T2}{T1}') Running the script gives: python Stossverlauf.py --verbose-helpful $HOME=/home/florian CONFIGDIR=/home/florian/.matplotlib matplotlib data path /usr/lib64/python2.6/site-packages/matplotlib/mpl-data loaded rc file /home/florian/.matplotlib/matplotlibrc matplotlib version 0.99.1.1 verbose.level helpful interactive is False units is False platform is linux2 Using fontManager instance from /home/florian/.matplotlib/fontList.cache /usr/lib/python2.6/site-packages/pytz/tzinfo.py:5: DeprecationWarning: the sets module is deprecated from sets import Set backend Agg version v2.2 and that's all, no plot window appears, the script is finished. If I remove the matplotlibrc everything works fine (of course no LaTeX). I think all the necessary programs are in place: flor...@horus:~ which latex /usr/local/bin/latex flor...@horus:~ which dvipng /usr/local/bin/dvipng flor...@horus:~ which gs /usr/bin/gs Any idea what could be wrong? Thanks, Florian -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem using TeX
Florian Lindner wrote: Hello, I try to use LaTeX in my plot flor...@horus:~ cat .matplotlib/matplotlibrc text.usetex: true My plotting code looks like: Ma = arange(1.0, 5.0, 0.01) Ts = [T(i) for i in Ma] # BTW: Is there a way to spare this line? not sure what T is. you could try T(Ma); you can do that of course also directly in the plot command plot(Ma, Ts, label=r'/frac{T2}{T1}') should be backslash and math mode: plot(Ma, Ts, label=r'$\frac{T2}{T1}$') legend() show() and that's all, no plot window appears, the script is finished. you did not show() ! best, sebastian. signature.asc Description: OpenPGP digital signature -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem using TeX
Florian Lindner wrote: Hello, I try to use LaTeX in my plot. I follow the instructions from http://www.scipy.org/Cookbook/Matplotlib/UsingTex flor...@horus:~ cat .matplotlib/matplotlibrc text.usetex: true My plotting code looks like: Ma = arange(1.0, 5.0, 0.01) Ts = [T(i) for i in Ma] # BTW: Is there a way to spare this line? plot(Ma, Ts, label=r'/frac{T2}{T1}') Running the script gives: python Stossverlauf.py --verbose-helpful $HOME=/home/florian CONFIGDIR=/home/florian/.matplotlib matplotlib data path /usr/lib64/python2.6/site-packages/matplotlib/mpl-data loaded rc file /home/florian/.matplotlib/matplotlibrc matplotlib version 0.99.1.1 verbose.level helpful interactive is False units is False platform is linux2 Using fontManager instance from /home/florian/.matplotlib/fontList.cache /usr/lib/python2.6/site-packages/pytz/tzinfo.py:5: DeprecationWarning: the sets module is deprecated from sets import Set backend Agg version v2.2 and that's all, no plot window appears, the script is finished. If I remove the matplotlibrc everything works fine (of course no LaTeX). I think all the necessary programs are in place: flor...@horus:~ which latex /usr/local/bin/latex flor...@horus:~ which dvipng /usr/local/bin/dvipng flor...@horus:~ which gs /usr/bin/gs Any idea what could be wrong? In addition to Sebastian's points, make sure your matplotlibrc is specifying an interactive backend (e.g. gtkagg, tkagg, wxagg, qt4agg) if you want the plot to appear on the screen. Eric Thanks, Florian -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users