Re: [Matplotlib-users] cycling mechanism
On 01/05/2012 05:58 PM, Benjamin Root wrote: On Thu, Jan 5, 2012 at 10:40 AM, Benjamin Root ben.r...@ou.edu mailto:ben.r...@ou.edu wrote: At the very least, it would help in compartmentallizing all the possible drawing attributes that are common across all artists. Currently, I am envisioning using a defaultdict object (which was introduced in python 2.5) or subclassing from it. This might help in keeping compatibility with existing code. Subclassing would allow for modifying __get__ and __set__ to treat some elements like 'c' and 'color', 'lw' and 'linewidth' and so on as the same. G, in defaultdict(), the default_factory is called without arguments, so a factory can't be made to produce a default value for a given key, unless I resort to more hackary... FWIW, defaultdict() only uses the __missing__ dictionary hook, and that one is passed the key. It's easy to implement a similar class that calls the factory with a key argument. Georg -- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Draw twin axes below main axes
Jae-Joon Lee schrieb: On Fri, Oct 9, 2009 at 10:55 AM, Georg Brandl georg.bra...@frm2.tum.de wrote: Hi, I want to make a plot with ordinary subplots, each of which has a second axes set created with twinx(). Now, the second axes are always drawn over the first, but I want the main data, which is associated with the left Y axis, to be in front. (If I understand the code correctly, the zorder doesn't help here since it only applies to stuff within one axes set.) I've already tried reversing the order of the two axes in figure.axes, but that results in (apparently) only the first axes being drawn. Is there a way to get this working? Reordering the axes should work. The reason for only the first axes being shown is that the frame (white background) of the main axes blocks the content of the twin axes. Try something like below. fig.axes = [ax2, ax1] # reorder ax1.set_frame_on(False) ax2.set_frame_on(True) Yes, that works! Many thanks. BTW, from Gnuplot I missed the ability to press q to close a figure window and wrote a custom key handler to do that; would it make sense to add that by default? Georg -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Draw twin axes below main axes
Hi, I want to make a plot with ordinary subplots, each of which has a second axes set created with twinx(). Now, the second axes are always drawn over the first, but I want the main data, which is associated with the left Y axis, to be in front. (If I understand the code correctly, the zorder doesn't help here since it only applies to stuff within one axes set.) I've already tried reversing the order of the two axes in figure.axes, but that results in (apparently) only the first axes being drawn. Is there a way to get this working? thanks, Georg -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Absolute spacing for embedded figure
Hi, I'm currently using Qwt to display a plot in a GUI application, but I'd like to replace it with matplotlib and a shell window, so that the user can not only view the plot but also modify it in-place using pyplot commands. One thing I'd like to do is to adjust the spacing surrounding the plot to be constant, regardless of the window size. Since the plot window is resized often, it is impossible to use very small subplot params and a waste of viewing space to use larger ones when the window is maximized. Is there a way to make the figure use absolute params like 20 pixels/points? Second, less important question: is there a way to give default font properties (like weight=bold) for axis labels? Third, I normally get my data one point at a time. Is there a more efficient way to insert single data points in existing plots than doing set_xdata/set_ydata? Thanks, Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users