Re: [Matplotlib-users] Evolution of the interface
On Mar 15, 2013 4:01 PM, Christophe BAL projet...@gmail.com wrote: Hello, I really appreciate the work done by matplotlib but I really think that the interface must evolve. Here is a small example. object.set_something(...) object.get_something() It could be easier to use a jQuery like style as in the following lines. object(...) object() This will considerably simplify things. Here is a more realistic example. fig = pylab.figure() ax = fig.add_subplot(1,1,1) ax.set_xlabel(xLabel) ax.set_ylabel(yLabel) The a jQuery like style would be as in the following lines. fig = pylab.figure() ax = fig.add_subplot(1,1,1) ax(xlabel = xLabel, ylabel = yLabel) I don't know enough matplotlib to propose other examples but I really think that there is a lot of things that could make matplotlib much more Pythonicly easy to use. Christophe BAL I don't personally like this approach. Python has very clear separation between the initialization of methods, which acts like a function that returns an instance, and the modification of existing instances, which uses attributes. This syntax muddies the distinction, having something that should behave like an instance instead behaving as a function. Is there any precedence for using this sort of syntax in python? I have not seen it anywhere else. You mention jQuery, but that is JavaScript not python. As far as I have seen -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [matplotlib-devel] ANN: mpltools 0.1 release
On Wed, Jul 11, 2012 at 5:23 PM, John Hunter jdh2...@gmail.com wrote: On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall damon.mcdoug...@gmail.com wrote: Well, as Ben said, that error fill plot is neato! It doesn't look too complicated, either. I'd be more than happy to port it over later today when I get bored of typing up my thesis. It'll probably only take me about 30 minutes. If nobody is opposed to this idea, I'll go ahead and submit a PR this evening (British Summer (hah!) Time). While it is a nice graph, I am not sure that the use case is common enough to justify a new plotting method. One can get the same result with: In [68]: x = np.linspace(0, 2 * np.pi) In [69]: y_sin = np.sin(x) In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) In [71]: plot(x, y_sin) Out[71]: [matplotlib.lines.Line2D object at 0x96959ec] In [72]: fill_between(np.concatenate([x, x[::-1]]), err, facecolor='red', alpha=0.5) Out[72]: matplotlib.collections.PolyCollection object at 0x962758c Admittedly the [::-1] thing is a bit counter-intuitive, but rather than adding a new plotting method, perhaps we would be better off with a helper method to create the xs and ys for fill_between xs, ys = mlab.pad_line(x, y, 0.2) fill_between(xs, ys) JDH What about adding a property to the existing errorbar to let someone change it to the filled version? This could also, potentially, be extended with other types of error bars if the need arises. -Todd -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] who (F/OSS science) uses matplotlib?
On Wed, Jun 6, 2012 at 8:01 AM, Guillaume Gay guilla...@mitotic-machine.org wrote: Le 05/06/2012 16:25, Tom Dimiduk a écrit : Is any of this stuff I should be looking to upstream or split off into the start of a scientific imaging library for python? Have you had a look at skimage https://github.com/scikits-image ? BTW I uses matplotlib (and the whole pylab suite) in my projects for all the visualisation. A (peer reviewed published) example here: https://github.com/Kinetochore-segregation Best Guillaume The Spyder (http://code.google.com/p/spyderlib/) python-based matlab clone uses matplotlib for plotting. Python(X,Y) (http://code.google.com/p/pythonxy/) is an integrated windows python release that includes a ton of science, engineering, and mathematics-oriented python packages, including matplotlib. Numpy uses small bits of matplotlib when building the documentation, but I don't know if that counts (I think it may even use it for building matplotlib-related parts of the documentation, in which case it really doesn't count). I know someone is working on a pure python backend for the Cantor advanced mathematics software (http://edu.kde.org/cantor/). The project only started recently, however (see http://blog.filipesaraiva.info/?p=779 ). There is also already a sage backend for Cantor, which of course uses matplotlib for plotting because that is what sage uses. -Todd -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Matplotlib plugin for Qt Designer
I am interested in making a python GUI that includes an axis. Qt's python bindings offers most of the GUI elements I need, and Qt designer provides a great graphical design tool for making python user interfaces. However, I notice that matplotlib is not integrated with Qt Designer. Qt Designer allows other programs to integrate with it by using plugins. However, matplotlib does not ship a Qt Designer plugin. It seems that it is possible to use one, since python (x,y) has a matplotlib Qt Designer plugin, but that is windows and I am using Linux. Is there any chance that matplotlib could ship a Qt Designer plugin? -Todd -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Feature request: automatic scaling of subplots, margins, etc
On Wed, May 11, 2011 at 1:59 PM, Benjamin Root ben.r...@ou.edu wrote: On Wed, May 11, 2011 at 12:47 PM, Brendan Barnwell brenb...@brenbarn.net wrote: One thing I've always wondered: is it fundamentally impossible to change the fact that, in matplotlib, you cannot know how big a drawn object will be until you actually draw it? When I was doing some animation stuff a while back this caused me a lot of headache, for the reasons Tony Yu mentioned: it means you have to draw everything multiple times. It would really help if it were possible to specify objects' parameters and get their sizes without drawing them. -- Brendan Barnwell Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail. --author unknown Most things, we do know the sizes of. It is my understanding that it is the text objects that is the unknown. If this could be solved, then a layout engine would be much more feasible. The problem is that even LaTeX has to re-render things multiple times to get this right for an arbitrary font. If we were to restrict ourselves to particular fonts and package those fonts with matplotlib, then we could have an internal table of size information for each glyph and compute it on the fly and lay everything out right. But, that would cause us to give up significant benefits for another benefit. I think the pain of the bootstrapping/re-rendering approach could be reduced significantly if we could get various aspects of matplotlib figure building to be faster. Last time I checked, there is significant amount of processing time spent in calculating the ticks for the axes. Maybe if we focus some efforts in improving the efficiency of certain parts of matplotlib, maybe we could introduce a convenience function like the one earlier in this thread that some users can choose to use with only a slight penalty in speed. I personally would not want to make it default, but certainly would consider highly advertising such a function. Just my two cents, Ben Root Perhaps there could be three options: 1. Manual mode: current behavior 2. Database mode: uses a list of known fonts. When a font not found in the database is used, it falls back to manual mode. 3. Automatic mode: uses a list of known fonts. When a font not found in the database is used, it renders the text alone in an invisible figure to calculate the space needed, then uses that information to set the margins. Alternatively, create a temporary mini font database just for the characters needed. The former approach may be faster, but the latter may be easier to program since it could share a lot of code with the database. There could also be a function to scan a particular font and add to the database (there would probably be a separate user database in your matplotlib configuration directory that this would use, as well as probably caching the measurements from text used in automatic mode for future versions of the figure). -Todd -- Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Fonts not found
On Thu, Jan 20, 2011 at 2:09 PM, Uri Laserson laser...@mit.edu wrote: Hi all, I recently reinstalled MPL from scratch on top of python2.7 that I built from scratch using homebrew on OS X Snow Leopard. Since then, I have been getting the following types of warnings whenever I plot something: /Users/laserson/matplotlib/lib/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) Do I need to specify some configuration parameter to point somewhere that the installer couldn't find? Thanks! Uri I had the same problem when I upgraded from python 2.6 to 2.7. For me, the issue turned out to be with my matplotlib font cache, which was stored in my matplotlib config directory. On linux it is in .matplotlib directory in the home directory, I am not sure if this is where it is on a mac. I deleted the fontList.cache file and the tex.cache directory stored there, and that fixed the problem. I am not sure you need to delete both of these, but since they were just caches I went ahead and did so. -Todd -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
On Wed, Jan 19, 2011 at 10:22 AM, Benjamin Root ben.r...@ou.edu wrote: On Wed, Jan 19, 2011 at 4:48 AM, Jochen Deibele jochen.deib...@ntnu.no wrote: Hi! todd rme wrote on 19.01.2011 04:40: The class, on the other hand, seems to be an application-specific description of what the role is within the application. I think this should probably be figure. Just an idea: What about exposing this (or maybe all) of the values in the api to be set dynamically by the user? Of course providing a useful default value as well. The thought behind is that it's hard to guess in what context the user wants to use the figure. And perhaps the user has 21 plots of some type and one which is different and he wants to treat differently. But at the same time - you also could do this if you adjust the window title. Jochen I agree. If we are going to do this, we might as well do it right. Anybody who isn't using this feature will not see a difference, but those who do manage their windows with rules can benefit significantly from just having sensible default values and from having the ability to explicitly set the value. Therefore, this should probably be something that is added to the rcParams and the user can specify a value by keyword argument to the Figure __init__ method. Ben Root That is far outside the scope of my capabilities. I already have wx and gtk backends set up (although it needs to be tested) with hard-coded values, and qt4 half-working (and tested, this doesn't appear to be possible in qt). I can submit patches for that, and if someone else wants to make it configurable they can do so. I'll set it up to use variables that you can then do what you want with. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] [SciPy-User] (no subject)
On Wed, Jan 19, 2011 at 10:16 AM, Benjamin Root ben.r...@ou.edu wrote: On Tue, Jan 18, 2011 at 5:32 PM, Alex Liberzon alex.liber...@gmail.com wrote: Hi, While moving from Matlab to Numpy/Scipy/Matplotlib I need sometimes to work with Matlab figures. It would be nice if we could load Matlab figures in Python, extract the data and some basic parameters of how it was looking in Matlab and create its clone in matplotlib. At present the Matlab figures are MAT files and in the near future it will be HDF5, both formats are loadable. However, I have not found any reference for such attempts to load and parse the FIG files. As a beginner I find it difficult to write a large piece of code. However, if there are other interested users that can cooperate on such, I'd gladly contribute some hours for this task. Meanwhile, to show the proof-of-concept attempt is attached below. All your useful comments and suggestions are very welcome. Thank you, Alex Alex, That is very interesting. I was not aware that matlab's figure files were simply .mat files in disguise. I would presume that it would be feasible to produce some sort of importer in such a case (provided the documentation for Matlab's figure format is complete enough). I am wary of making such a function a core feature of Matplotlib, however, because it would require creating a dependency to the scipy.io package. However, I could see it being a toolkit package like Basemap. Would you mind creating a feature request ticket at: http://sourceforge.net/tracker/?group_id=80706 If you include this example code, and maybe some links to some documentation on matlab's figure files, maybe something can grow from that. Thanks! Ben Root I agree, but for a slightly different reason. I think it would be great if it would be possible to incorporate viewing matlab figures into the rest of my system, so making it more isolated would help in this regard. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
Maybe, I am not that familiar with X11 programming. Do you happen to know which source files I should change? -Todd On Tue, Jan 18, 2011 at 8:39 AM, Michael Droettboom md...@stsci.edu wrote: You're right -- matplotlib doesn't set any of these attributes. Fixing this problem would involve adding a few lines of code to set them in each GUI backend (since each GUI toolkit, gtk, qt, tk etc. presumably handles them differently). Is this something you'd be interested in providing a patch for? Mike On 01/15/2011 03:06 PM, todd rme wrote: On X11 systems, windows generally provide information about themselves to the system. These include things like the window title, window class, window role, and window type. These allow window managers to properly handle the windows, and in some window managers (like KDE's kwin), lets you set rules for windows of certain types. As best as I can tell, by default matplotlib does not provide most of this information. It provides the window title and the window type, but it doesn't seem to provide the window class or the window role. These two properties, however, are exactly the properties someone would want to use when trying to set up rules for particular windows. This makes it impossible to set window-specific rules for the plots. Is there something in the matplotlib configuration that would let someone set these properties, and if not is there any way matplotlib could set them itself? I'm sorry if this is a common question. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
I think I've found it. But now I need to know what the values should be. I assume the application name should be matplotlib (no quotes, with no capitalization). What about the window role? I am think either figure or plot would be good, probably the former (once again without quotes and with no capitalization). Is that reasonable? It is easy to change later, although the change should be consistent across all backends. The other issue is whether I should use the same window role for all backends, or separate roles for each backend (such as qt4 figure). Does anyone have an opinion on this? -Todd On Tue, Jan 18, 2011 at 12:54 PM, todd rme toddrme2...@gmail.com wrote: Maybe, I am not that familiar with X11 programming. Do you happen to know which source files I should change? -Todd On Tue, Jan 18, 2011 at 8:39 AM, Michael Droettboom md...@stsci.edu wrote: You're right -- matplotlib doesn't set any of these attributes. Fixing this problem would involve adding a few lines of code to set them in each GUI backend (since each GUI toolkit, gtk, qt, tk etc. presumably handles them differently). Is this something you'd be interested in providing a patch for? Mike On 01/15/2011 03:06 PM, todd rme wrote: On X11 systems, windows generally provide information about themselves to the system. These include things like the window title, window class, window role, and window type. These allow window managers to properly handle the windows, and in some window managers (like KDE's kwin), lets you set rules for windows of certain types. As best as I can tell, by default matplotlib does not provide most of this information. It provides the window title and the window type, but it doesn't seem to provide the window class or the window role. These two properties, however, are exactly the properties someone would want to use when trying to set up rules for particular windows. This makes it impossible to set window-specific rules for the plots. Is there something in the matplotlib configuration that would let someone set these properties, and if not is there any way matplotlib could set them itself? I'm sorry if this is a common question. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] X11 Window information for plots
On Tue, Jan 18, 2011 at 8:58 PM, Benjamin Root ben.r...@ou.edu wrote: On Tuesday, January 18, 2011, todd rme toddrme2...@gmail.com wrote: I think I've found it. But now I need to know what the values should be. I assume the application name should be matplotlib (no quotes, with no capitalization). What about the window role? I am think either figure or plot would be good, probably the former (once again without quotes and with no capitalization). Is that reasonable? It is easy to change later, although the change should be consistent across all backends. The other issue is whether I should use the same window role for all backends, or separate roles for each backend (such as qt4 figure). Does anyone have an opinion on this? -Todd My guess is that they should all have the same name. Any given run of matplotlib can only use one backend at a time. I don't see a value in distinguishing the source of the figures. Ben Root That is what I thought as well. There are three properties to deal with. First the window class. This contains two strings. One is simply the application name. The other, however, is a class. I can't find a good explanation of what this is supposed to be. For Firefox, this is Navigator for the browser and Places for the bookmarks manager. For libreoffice writer, it is VCLSalFrame.DocumentWindow. The third is the window role. For the firefox browser, this is browser. For the bookmark manager, it is organizer. So as best as I can tell, the role is a general description of the sort of application it is, such as a web browser. For matplotlib, I think this should probably be plot or graph or something along those lines. The class, on the other hand, seems to be an application-specific description of what the role is within the application. I think this should probably be figure. Does that sound reasonable? -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] X11 Window information for plots
On X11 systems, windows generally provide information about themselves to the system. These include things like the window title, window class, window role, and window type. These allow window managers to properly handle the windows, and in some window managers (like KDE's kwin), lets you set rules for windows of certain types. As best as I can tell, by default matplotlib does not provide most of this information. It provides the window title and the window type, but it doesn't seem to provide the window class or the window role. These two properties, however, are exactly the properties someone would want to use when trying to set up rules for particular windows. This makes it impossible to set window-specific rules for the plots. Is there something in the matplotlib configuration that would let someone set these properties, and if not is there any way matplotlib could set them itself? I'm sorry if this is a common question. -Todd -- Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users