Re: [Matplotlib-users] date plot with two y axes...and some other things
On Thu, Nov 18, 2010 at 12:59 PM, C M cmpyt...@gmail.com wrote: Goals: date plot with two y axes (plotting completely different things) point picking and point labeling As many lines as user wants, all colored differently. Having some problems with this. (matplotlib 0.98.5) 1) There is a known bug with twinx() and plot_date: http://sourceforge.net/tracker/index.php?func=detailaid=3046812group_id=80706atid=560720 But I can get it to work if I change ONE OF the plot_date() calls (the one for the values plotted to the right-hand y axis) to just plot(). Is that going to introduce problems? Is there a better workaround? (The ones on that page don't work for me). So far, so good with this. But for others working on it, I have found that the *order* of plotting matters. That is, I have two axes and I have to use plot() for one axis and plot_date() for the other, but it must be plot() that is used first or else I will get the error: ValueError: ordinal must be = 1. I'm managing my lines and grouping them by axes, and then making sure I plot all the lines on the axis that uses plot() first. Seems to work fine after that. 3) My point picking is not working with the two axes. In my routine, I label the picked point and to do that I have to make reference to its axis and call plot_date(). How can I know which axis the picked point came from, so that I can label it appropriately? I should have just thought about that more. Of course, there is the method myline.get_axes() for that. Che -- Increase Visibility of Your 3D Game App Earn a Chance To Win $500! Tap into the largest installed PC base get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] date plot with two y axes...and some other things
On Fri, Nov 19, 2010 at 2:59 AM, C M cmpyt...@gmail.com wrote: 2) How can I get the lines belonging to different axes to cycle through colors such that the same color is not used for any lines shown in the plot? (that is, I don't want to hard code a color to any line, I want it to auto-cycle). ax1 = subplot(121) ax2 = subplot(122) import itertools clist = ['b', 'g', 'r', 'c', 'm', 'y', 'k'] color_cycle = itertools.cycle(clist) ax1.set_color_cycle(color_cycle) ax2.set_color_cycle(color_cycle) ax1.plot([1,2,3]) ax2.plot([1,3,2]) -JJ -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] date plot with two y axes...and some other things
Goals: date plot with two y axes (plotting completely different things) point picking and point labeling As many lines as user wants, all colored differently. Having some problems with this. (matplotlib 0.98.5) 1) There is a known bug with twinx() and plot_date: http://sourceforge.net/tracker/index.php?func=detailaid=3046812group_id=80706atid=560720 But I can get it to work if I change ONE OF the plot_date() calls (the one for the values plotted to the right-hand y axis) to just plot(). Is that going to introduce problems? Is there a better workaround? (The ones on that page don't work for me). 2) How can I get the lines belonging to different axes to cycle through colors such that the same color is not used for any lines shown in the plot? (that is, I don't want to hard code a color to any line, I want it to auto-cycle). 3) My point picking is not working with the two axes. In my routine, I label the picked point and to do that I have to make reference to its axis and call plot_date(). How can I know which axis the picked point came from, so that I can label it appropriately? Sorry this is a little stirred together, but hoping I can get some hints to allow me to work it into shape. Thanks, Che -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users