SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(2)
2
(1)
3
(17)
4
(9)
5
(2)
6
(5)
7
(8)
8
(11)
9
(6)
10
(6)
11
(21)
12
(21)
13
(17)
14
(25)
15
(15)
16
(2)
17
18
(9)
19
(22)
20
(25)
21
(31)
22
(19)
23
(2)
24
(5)
25
(19)
26
(10)
27
(13)
28
(14)
29
(20)
30
(5)
31
(9)






Showing results of 346

<< < 1 .. 8 9 10 11 12 .. 14 > >> (Page 10 of 14)
From: Gökhan S. <gok...@gm...> - 2010年01月13日 20:27:35
On Wed, Jan 13, 2010 at 11:22 AM, Jae-Joon Lee <lee...@gm...> wrote:
> On Wed, Jan 13, 2010 at 11:32 AM, Gökhan Sever <gok...@gm...>
> wrote:
> > I printed the PNG and PS file. The result looks same on paper as well. I
> was
> > comparing the two ps file one from IDL one from MPL. IDL looks neat both
> on
> > the screen and printed.
> >
>
> Are you saying that the printout of the mpl-created postscript file
> still shows the jiggly rendering as displayed in your monitor? I
> highly doubt that (hmm, but it may depends on how you print the
> files).
>
This is true, the printout looks ugly like I am seeing on my monitor. I am
on Fedora 12, and use the print menu of my evince tool to print out the
file. Is there a special method to print eps files?
>
> ps or pdf, as far as same font is used, I don't see any reason that
> pdf quality is better than ps (and I never felt that way in my
> experience). Again, monitor display is a different story.
>
See the last comparison screenshot:
http://img40.imageshack.us/img40/7461/pdfepspng.png
And these are settings that I enabled while creating this plots. (Plus for
the png I used 600 dpi)
# ps backend params
ps.papersize : auto # auto, letter, legal, ledger, A0-A10, B0-B10
ps.usedistiller : xpdf # can be: None, ghostscript or xpdf
ps.distiller.res : 6000 # dpi
ps.fonttype : 42 # Output Type 3 (Type3) or Type 42 (TrueType)
# pdf backend params
pdf.compression : 0 # integer from 0 to 9
pdf.fonttype : 42 # Output Type 3 (Type3) or Type 42
(TrueType)
PNG with high resolution produces the nicest looking plot. PDF follows it.
However EPS file still looks ugly. What are your font suggestions? An any
ideas why ps.distiller.res has no effect on the produced plot?
Could somebody reproduce the similar results?
Thanks.
>
> Again, if you want your figures look goon on your monitor, postscript
> is not the way to go in my opinion. And I don't think this is an issue
> of the matplotlib side, so I'm afraid that there is anything I can
> help in this regard.
>
> Regards,
>
> -JJ
>
-- 
Gökhan
From: Jonathan S. <js...@cf...> - 2010年01月13日 18:52:07
Instead of appending the points to xs and ys and doing plot(xs,ys) each
time, why not just do plot(x,y)? If you want to save the data in the xs,
ys arrays you can do that without replotting the entire array.
Jon
On Wed, 2010年01月13日 at 10:14 -0800, Someday... wrote:
> Hello all,
> 
> I am looking for a way to add points gradually to the plot over time.
> Currently, in every iteration, I plot the entire array, like:
> 
> fig = plt.figure();
> ax = fig.gca()
> xs = array([])
> ys = array([])
> while not done:
> // do some calculation..
> // x=???, y=???
> xs = append(xs,x);
> ys = append(ys,y);
> ax.plot(xs,ys)
> plt.draw()
> 
> However, it seems like that the figure is re-drawn completely and so
> significantly harms the performance. Rather, I want to add point each
> iteration to the plot.
> 
> fig = plt.figure();
> ax = fig.gca()
> while not done:
> // do some calculation..
> // x=???, y=???
> ax.AddPoint(x,y)
> plt.draw() // or update()?
> 
> I searched tutorials, but I couldn't find anything related yet. If anyone
> knows how, please let me know.
> 
> Thanks all,
> 
-- 
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
 cell: (781) 363-0035 USA
______________________________________________________________
From: Someday... <bac...@gm...> - 2010年01月13日 18:24:22
Hello all,
I am looking for a way to add points gradually to the plot over time.
Currently, in every iteration, I plot the entire array, like:
fig = plt.figure();
ax = fig.gca()
xs = array([])
ys = array([])
while not done:
 // do some calculation..
 // x=???, y=???
 xs = append(xs,x);
 ys = append(ys,y);
 ax.plot(xs,ys)
 plt.draw()
However, it seems like that the figure is re-drawn completely and so
significantly harms the performance. Rather, I want to add point each
iteration to the plot.
fig = plt.figure();
ax = fig.gca()
while not done:
 // do some calculation..
 // x=???, y=???
 ax.AddPoint(x,y)
 plt.draw() // or update()?
I searched tutorials, but I couldn't find anything related yet. If anyone
knows how, please let me know.
Thanks all,
-- 
View this message in context: http://old.nabble.com/Adding-points-gradually-to-the-plot-tp27148794p27148794.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2010年01月13日 17:28:39
On Wed, Jan 13, 2010 at 11:32 AM, Gökhan Sever <gok...@gm...> wrote:
> I printed the PNG and PS file. The result looks same on paper as well. I was
> comparing the two ps file one from IDL one from MPL. IDL looks neat both on
> the screen and printed.
>
Are you saying that the printout of the mpl-created postscript file
still shows the jiggly rendering as displayed in your monitor? I
highly doubt that (hmm, but it may depends on how you print the
files).
ps or pdf, as far as same font is used, I don't see any reason that
pdf quality is better than ps (and I never felt that way in my
experience). Again, monitor display is a different story.
Again, if you want your figures look goon on your monitor, postscript
is not the way to go in my opinion. And I don't think this is an issue
of the matplotlib side, so I'm afraid that there is anything I can
help in this regard.
Regards,
-JJ
From: Gökhan S. <gok...@gm...> - 2010年01月13日 16:39:10
On Wed, Jan 13, 2010 at 10:32 AM, Gökhan Sever <gok...@gm...>wrote:
>
>
> On Wed, Jan 13, 2010 at 10:08 AM, Jae-Joon Lee <lee...@gm...>wrote:
>
>> On Tue, Jan 12, 2010 at 9:56 PM, Gökhan Sever <gok...@gm...>
>> wrote:
>> > What could be causing this discrepancy? Is there any way to use an
>> > alternative PS creator with MPL? or an option to increase e.g. bits per
>> > pixel option somewhere in the configuration?
>> >
>>
>> There can be a lot of things. However, you cannot just say one is
>> better than the other based on how it looks on your monitor screen.
>> As far as I can tell, postscript is best for printing, but not very
>> optimal for your monitor screen.
>>
>
> I printed the PNG and PS file. The result looks same on paper as well. I
> was comparing the two ps file one from IDL one from MPL. IDL looks neat both
> on the screen and printed.
>
>
>>
>> While matplotlib with the xpdf distiller could be better than
>> ghostsrcipt one in this regard, but, again, postscipt on your monitor
>> screen does not make much sense, at least to me.
>>
>> -JJ
>>
>
> OK, here is one more comparison.
>
> I use xpdf distiller, and set the pdf comparison to 0 in the rc file.
>
> http://ccnworks.googlecode.com/svn/trunk/test.png
> http://ccnworks.googlecode.com/svn/trunk/test.ps
> http://ccnworks.googlecode.com/svn/trunk/test.eps
> http://ccnworks.googlecode.com/svn/trunk/test.pdf
>
> PS and EPS outputs are almost alike to my eye. Setting ps.distiller.res to
> 6000 DPI doesn't make a difference either. PDF backend produces the highest
> quality output. However the problem with that I can't include pdf images on
> a regular OpenOffice document :(
>
> With xpdf the line is plotted blue correctly as it is seen on my screen.
> Before it was drawing a red-line.
>
> --
> Gökhan
>
It seems like ps.distiller.res parameter doesn't have an effect on the
output ps file. I set this to 60 and 6000 and 60000 it all produces same
sized same looking figures. Any ideas?
-- 
Gökhan
From: Jae-Joon L. <lee...@gm...> - 2010年01月13日 16:32:30
The workarounds suggested in this thread does not work?
To me, the ordinal thing is not actually a bug, but you need some
extra caution to avoid this error happening.
The issue with the label roration is a different matter though.
Regards,
-JJ
On Wed, Jan 13, 2010 at 8:16 AM, Rodribat <rod...@gm...> wrote:
>
>
> Hi matplotlib users!
>
> Did someone solve the problem of use fig.autofmt_xdate() function with
> SubplotHost object?
> I googled for it and I found this question only here, without solution. Is
> there a bug? Anyone knows
> someway to solve this?
>
> Thank you,
>
> []'s
>
> Rodrigo Batista
>
>
> David GUERINEAU wrote:
>>
>> Hi matplotlib_users !
>>
>> I'm David from Berlin, and believe I'm experiencing some problem with the
>> SubplotHost module:
>>
>> I'm generating graphs from hudge databases of cpu and ethernet statistics,
>> and I wanted to mix several graphs concerning ethernet statistics in the
>> same figure,
>> with time as x axis, and bytes-in, bytes-out, packets-in, packets-out and
>> number of
>> collisions as three different y axes, with three different scale.
>>
>> I took the inspiration from
>>
>> for the x axes and from
>>
>> http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes2.html
>> for the y axes
>>
>> The following code is a synthetic reproduction of the problem I'm
>> experiencing (it is also attached):
>>
>> from matplotlib.dates import date2num
>> from matplotlib import pyplot
>> from matplotlib import pylab
>> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
>> from datetime import datetime
>>
>> dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593,
>> 733581.20847222221, 733581.20851851848,
>>    733581.20855324075, 733581.20858796302, 733581.2086342593,
>> 733581.20866898145, 733581.20871527772]
>> rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L]
>> txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L]
>> rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91]
>> txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77]
>> col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>
>> ethPlot = pyplot
>> fig = ethPlot.figure()
>> host = SubplotHost(fig, 111)
>>
>> host.set_ylabel("kB/s")
>> host.set_xlabel("Time")
>>
>> par1 = host.twinx()
>> par2 = host.twinx()
>>
>> par1.set_ylabel("Packets/s")
>>
>> par2.axis["right"].set_visible(False)
>>
>> offset = 60, 0
>> new_axisline = par2.get_grid_helper().new_fixed_axis
>> par2.axis["right2"] = new_axisline(loc="right",
>>           axes=par2,
>>           offset=offset)
>>
>> par2.axis["right2"].label.set_visible(True)
>> par2.axis["right2"].set_label("Collisions")
>>
>> par1.set_ylim(0, 6000)
>> par2.set_ylim(0, 7000)
>>
>> host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000])
>> par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000])
>> par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700])
>>
>> fig.add_axes(host)
>> ethPlot.subplots_adjust(right=0.75)
>>
>> drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True,
>> ydate=False, label="kB/s in")
>> drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True,
>> ydate=False, label="kB/s out")
>> drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True,
>> ydate=False, label="packets/s in")
>> drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True,
>> ydate=False, label="packets/s out")
>> drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True,
>> ydate=False, label="collisions")
>>
>> fig.autofmt_xdate()
>>
>> host.set_xlabel("Time")
>> host.set_ylabel("kB/s")
>> par1.set_ylabel("Packets/s")
>>
>> host.legend()
>>
>> host.axis["left"].label.set_color(drawRxByt.get_color())
>> host.axis["left"].label.set_color(drawTxByt.get_color())
>> par1.axis["right"].label.set_color(drawRxPaq.get_color())
>> par1.axis["right"].label.set_color(drawtxPaq.get_color())
>> par2.axis["right2"].label.set_color(drawColls.get_color())
>>
>> ethPlot.draw()
>> pylab.savefig( './test.png', dpi=(640/8))
>>
>>
>>
>>
>> Maybe I do something wrong somewhere here, but other scripts that do the
>> same for a single graphwork like a charm. So it's not a question of
>> dataType
>> or something. To compare with a working code, here is the first version of
>> the fuction that does the job on single graphs without any problem :
>>
>> def drawEthGraph(filename, hdates, rxP, txP, rxB, txB, col):
>>  ethPlot = pyplot
>>  fig = ethPlot.figure()
>>  ax = fig.add_subplot(111)
>>  ax.plot_date(hdates, rxP, 'g', None, True, False)
>>  ax.plot_date(hdates, txP, 'b', None, True, False)
>>  ax.plot_date(hdates, rxB, 'g', None, True, False)
>>  ax.plot_date(hdates, txB, 'b', None, True, False)
>>  ax.plot_date(hdates, col, 'r', None, True, False)
>>  ax.axis([ hdates[0], ( hdates[0] + 0.042 ), -7000, 7000])
>>  ax.grid(True)
>>  fig.autofmt_xdate()
>>  pylab.savefig( filename, dpi=(640/8))
>>
>>
>> I don't think I understand the whole process of generation, but I thought
>> at
>> least at the beginnig I was having a good feeling with this API.
>> Now I wonder how to go around this. Maybe you'll have an idea :-o
>>
>> Best regards
>>
>> DvD
>>
>> from matplotlib.dates import date2num
>> from matplotlib import pyplot
>> from matplotlib import pylab
>> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
>> from datetime import datetime
>>
>> dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593,
>> 733581.20847222221, 733581.20851851848,
>>     733581.20855324075, 733581.20858796302, 733581.2086342593,
>> 733581.20866898145, 733581.20871527772]
>> rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L]
>> txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L]
>> rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91]
>> txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77]
>> col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>
>> ethPlot = pyplot
>> fig = ethPlot.figure()
>> host = SubplotHost(fig, 111)
>>
>> host.set_ylabel("kB/s")
>> host.set_xlabel("Time")
>>
>> par1 = host.twinx()
>> par2 = host.twinx()
>>
>> par1.set_ylabel("Packets/s")
>>
>> par2.axis["right"].set_visible(False)
>>
>> offset = 60, 0
>> new_axisline = par2.get_grid_helper().new_fixed_axis
>> par2.axis["right2"] = new_axisline(loc="right",
>>                  axes=par2,
>>                  offset=offset)
>>
>> par2.axis["right2"].label.set_visible(True)
>> par2.axis["right2"].set_label("Collisions")
>>
>> par1.set_ylim(0, 6000)
>> par2.set_ylim(0, 7000)
>>
>> host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000])
>> par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000])
>> par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700])
>>
>> fig.add_axes(host)
>> ethPlot.subplots_adjust(right=0.75)
>>
>> drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True,
>> ydate=False, label="kB/s in")
>> drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True,
>> ydate=False, label="kB/s out")
>> drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True,
>> ydate=False, label="packets/s in")
>> drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True,
>> ydate=False, label="packets/s out")
>> drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True,
>> ydate=False, label="collisions")
>>
>> fig.autofmt_xdate()
>>
>> host.set_xlabel("Time")
>> host.set_ylabel("kB/s")
>> par1.set_ylabel("Packets/s")
>>
>> host.legend()
>>
>> host.axis["left"].label.set_color(drawRxByt.get_color())
>> host.axis["left"].label.set_color(drawTxByt.get_color())
>> par1.axis["right"].label.set_color(drawRxPaq.get_color())
>> par1.axis["right"].label.set_color(drawtxPaq.get_color())
>> par2.axis["right2"].label.set_color(drawColls.get_color())
>>
>> ethPlot.draw()
>> pylab.savefig( './test.png', dpi=(640/8))
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> View this message in context: http://old.nabble.com/%22Ordinal-must-be-%3E%3D-1%22-with-SuplotHost-and-dates-tp24305444p27144728.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Gökhan S. <gok...@gm...> - 2010年01月13日 16:32:19
On Wed, Jan 13, 2010 at 10:08 AM, Jae-Joon Lee <lee...@gm...> wrote:
> On Tue, Jan 12, 2010 at 9:56 PM, Gökhan Sever <gok...@gm...>
> wrote:
> > What could be causing this discrepancy? Is there any way to use an
> > alternative PS creator with MPL? or an option to increase e.g. bits per
> > pixel option somewhere in the configuration?
> >
>
> There can be a lot of things. However, you cannot just say one is
> better than the other based on how it looks on your monitor screen.
> As far as I can tell, postscript is best for printing, but not very
> optimal for your monitor screen.
>
I printed the PNG and PS file. The result looks same on paper as well. I was
comparing the two ps file one from IDL one from MPL. IDL looks neat both on
the screen and printed.
>
> While matplotlib with the xpdf distiller could be better than
> ghostsrcipt one in this regard, but, again, postscipt on your monitor
> screen does not make much sense, at least to me.
>
> -JJ
>
OK, here is one more comparison.
I use xpdf distiller, and set the pdf comparison to 0 in the rc file.
http://ccnworks.googlecode.com/svn/trunk/test.png
http://ccnworks.googlecode.com/svn/trunk/test.ps
http://ccnworks.googlecode.com/svn/trunk/test.eps
http://ccnworks.googlecode.com/svn/trunk/test.pdf
PS and EPS outputs are almost alike to my eye. Setting ps.distiller.res to
6000 DPI doesn't make a difference either. PDF backend produces the highest
quality output. However the problem with that I can't include pdf images on
a regular OpenOffice document :(
With xpdf the line is plotted blue correctly as it is seen on my screen.
Before it was drawing a red-line.
-- 
Gökhan
From: Jae-Joon L. <lee...@gm...> - 2010年01月13日 16:25:26
You may consider to use proxy artists.
plot([1,2,3], "s-")
plot([1,3,2], "d-")
l1 = Line2D([0], [0], marker="s", color="k")
l2 = Line2D([0], [0], marker="d", color="k")
p1 = Rectangle((0, 0), 1, 1, fc="b", ec="none")
p2 = Rectangle((0, 0), 1, 1, fc="g", ec="none")
legend([p1, p2, l1, l2], ["color1", "color2", "s", "d"], ncol=2)
Also see
http://matplotlib.sourceforge.net/users/legend_guide.html
There is no easy way to use text itself as the legend handles, and
this will need some more tweaks.
If you do need this, I'll try to come up with some example.
-JJ
On Wed, Jan 13, 2010 at 11:04 AM, Jeremy Conlin <jlc...@gm...> wrote:
> I have a plot that I need to add a customized legend. (The plot is
> attached to this email.) I want to show that each color represents
> something as well as each marker symbol. For example:
>
> Green -> a           Square -> j
> Blue  -> b           Circle  -> k
> Red  -> c           Triangle -> l
> Black -> d           Diamond -> m
>
>
> When representing the color, the symbol doesn't matter and vice versa
> for representing the symbol. Is there an easy way to do this or do I
> have to write some checks into my plotting function to make this
> happen.
>
> Thanks,
> Jeremy
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: John H. <jd...@gm...> - 2010年01月13日 16:23:35
On Wed, Jan 13, 2010 at 6:59 AM, boriq <bo...@gm...> wrote:
>
> Hi all,
>
> i have a plot with 2 y-axes and 1 x-axis. The mouse pointer shows the
> y-coordinates of the second y-axis, but I want the mouse pointer to show the
> y-coordinate of the first y-axis.
>
> Is there a way how to switch the mouse pointer to the first y-axis?
If you have overlapping axes using twinx, or twiny, the one with with
higher zorder gets the mouse signal. Using
http://matplotlib.sourceforge.net/examples/api/two_scales.html for
reference, both have a zorder of 1 and ax2 gets the signal be default.
 Unfortunately, one cannot simply set
 ax1.set_zorder(1)
While this does cause ax1 to get the mouse events and the toolbar
reports the coords from ax1, it is not hidden behind ax2 since "twiny"
does other stuff like making the "upper" axes frame invisible. So to
move ax1 to the top and have the figure draw correctly, you need
In [115]: ax1.set_zorder(0.1)
In [116]: ax1.set_frame_on(False)
In [117]: ax2.set_frame_on(True)
It would be nice to have a property like "receive_mouse" attached to
the axes which could be controlled/toggled from the figure window so
one could easily switch between which overlapping axes receives mouse
events.
JDH
From: John R. <j....@ma...> - 2010年01月13日 16:10:20
Jae-Joon Lee wrote:
> John,
> 
> Would you do me a favor and open a ticket for this? So that other
> developers can take a look in the future.
Have done:
https://sourceforge.net/tracker/?func=detail&aid=2931430&group_id=80706&atid=560720
From: Jae-Joon L. <lee...@gm...> - 2010年01月13日 16:08:27
On Tue, Jan 12, 2010 at 9:56 PM, Gökhan Sever <gok...@gm...> wrote:
> What could be causing this discrepancy? Is there any way to use an
> alternative PS creator with MPL? or an option to increase e.g. bits per
> pixel option somewhere in the configuration?
>
There can be a lot of things. However, you cannot just say one is
better than the other based on how it looks on your monitor screen.
As far as I can tell, postscript is best for printing, but not very
optimal for your monitor screen.
While matplotlib with the xpdf distiller could be better than
ghostsrcipt one in this regard, but, again, postscipt on your monitor
screen does not make much sense, at least to me.
-JJ
From: Jeremy C. <jlc...@gm...> - 2010年01月13日 16:05:04
Attachments: MPL.pdf
I have a plot that I need to add a customized legend. (The plot is
attached to this email.) I want to show that each color represents
something as well as each marker symbol. For example:
Green -> a Square -> j
Blue -> b Circle -> k
Red -> c Triangle -> l
Black -> d Diamond -> m
When representing the color, the symbol doesn't matter and vice versa
for representing the symbol. Is there an easy way to do this or do I
have to write some checks into my plotting function to make this
happen.
Thanks,
Jeremy
From: Jae-Joon L. <lee...@gm...> - 2010年01月13日 15:53:54
John,
Would you do me a favor and open a ticket for this? So that other
developers can take a look in the future.
http://sourceforge.net/tracker/?atid=560720&group_id=80706&func=browse
Please specify the options you're using, e.g., distiller, usetex,
ghostscript version, etc.
Regards,
-JJ
On Wed, Jan 13, 2010 at 3:16 AM, John Reid <j....@ma...> wrote:
>
>
> Jae-Joon Lee wrote:
>> I'm afraid that there is not much I can help anymore.
>>
>> Just in case, does the same error occur when my patch is not applied?
>>
>> Is it an error or just a warning? If it is an error, can you post a
>> full traceback? I just want to know what step causes that.
>>
>> Also, are you using the usetex mode? See if turning that on and off
>> make any difference.
> I tried turning usetex on and it works just fine as far as I can see.
> Thanks for the help.
>>
>> Regards,
>>
>> -JJ
>>
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Rodribat <rod...@gm...> - 2010年01月13日 13:16:51
Hi matplotlib users!
Did someone solve the problem of use fig.autofmt_xdate() function with
SubplotHost object?
I googled for it and I found this question only here, without solution. Is
there a bug? Anyone knows
someway to solve this?
Thank you,
[]'s
Rodrigo Batista
David GUERINEAU wrote:
> 
> Hi matplotlib_users !
> 
> I'm David from Berlin, and believe I'm experiencing some problem with the
> SubplotHost module:
> 
> I'm generating graphs from hudge databases of cpu and ethernet statistics,
> and I wanted to mix several graphs concerning ethernet statistics in the
> same figure,
> with time as x axis, and bytes-in, bytes-out, packets-in, packets-out and
> number of
> collisions as three different y axes, with three different scale.
> 
> I took the inspiration from
> 
> for the x axes and from
> 
> http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes2.html
> for the y axes
> 
> The following code is a synthetic reproduction of the problem I'm
> experiencing (it is also attached):
> 
> from matplotlib.dates import date2num
> from matplotlib import pyplot
> from matplotlib import pylab
> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
> from datetime import datetime
> 
> dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593,
> 733581.20847222221, 733581.20851851848,
> 733581.20855324075, 733581.20858796302, 733581.2086342593,
> 733581.20866898145, 733581.20871527772]
> rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L]
> txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L]
> rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91]
> txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77]
> col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
> 
> ethPlot = pyplot
> fig = ethPlot.figure()
> host = SubplotHost(fig, 111)
> 
> host.set_ylabel("kB/s")
> host.set_xlabel("Time")
> 
> par1 = host.twinx()
> par2 = host.twinx()
> 
> par1.set_ylabel("Packets/s")
> 
> par2.axis["right"].set_visible(False)
> 
> offset = 60, 0
> new_axisline = par2.get_grid_helper().new_fixed_axis
> par2.axis["right2"] = new_axisline(loc="right",
> axes=par2,
> offset=offset)
> 
> par2.axis["right2"].label.set_visible(True)
> par2.axis["right2"].set_label("Collisions")
> 
> par1.set_ylim(0, 6000)
> par2.set_ylim(0, 7000)
> 
> host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000])
> par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000])
> par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700])
> 
> fig.add_axes(host)
> ethPlot.subplots_adjust(right=0.75)
> 
> drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True,
> ydate=False, label="kB/s in")
> drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True,
> ydate=False, label="kB/s out")
> drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True,
> ydate=False, label="packets/s in")
> drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True,
> ydate=False, label="packets/s out")
> drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True,
> ydate=False, label="collisions")
> 
> fig.autofmt_xdate()
> 
> host.set_xlabel("Time")
> host.set_ylabel("kB/s")
> par1.set_ylabel("Packets/s")
> 
> host.legend()
> 
> host.axis["left"].label.set_color(drawRxByt.get_color())
> host.axis["left"].label.set_color(drawTxByt.get_color())
> par1.axis["right"].label.set_color(drawRxPaq.get_color())
> par1.axis["right"].label.set_color(drawtxPaq.get_color())
> par2.axis["right2"].label.set_color(drawColls.get_color())
> 
> ethPlot.draw()
> pylab.savefig( './test.png', dpi=(640/8))
> 
> 
> 
> 
> Maybe I do something wrong somewhere here, but other scripts that do the
> same for a single graphwork like a charm. So it's not a question of
> dataType
> or something. To compare with a working code, here is the first version of
> the fuction that does the job on single graphs without any problem :
> 
> def drawEthGraph(filename, hdates, rxP, txP, rxB, txB, col):
> ethPlot = pyplot
> fig = ethPlot.figure()
> ax = fig.add_subplot(111)
> ax.plot_date(hdates, rxP, 'g', None, True, False)
> ax.plot_date(hdates, txP, 'b', None, True, False)
> ax.plot_date(hdates, rxB, 'g', None, True, False)
> ax.plot_date(hdates, txB, 'b', None, True, False)
> ax.plot_date(hdates, col, 'r', None, True, False)
> ax.axis([ hdates[0], ( hdates[0] + 0.042 ), -7000, 7000])
> ax.grid(True)
> fig.autofmt_xdate()
> pylab.savefig( filename, dpi=(640/8))
> 
> 
> I don't think I understand the whole process of generation, but I thought
> at
> least at the beginnig I was having a good feeling with this API.
> Now I wonder how to go around this. Maybe you'll have an idea :-o
> 
> Best regards
> 
> DvD
> 
> from matplotlib.dates import date2num
> from matplotlib import pyplot 
> from matplotlib import pylab 
> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
> from datetime import datetime
> 
> dates = [ 733581.20833333337, 733581.20837962965, 733581.20842592593,
> 733581.20847222221, 733581.20851851848, 
> 	 733581.20855324075, 733581.20858796302, 733581.2086342593,
> 733581.20866898145, 733581.20871527772]
> rxB = [054L, 130L, 144L, 54L, 36L, 9L, 35L, 43L, 85L, 43L]
> txB = [4L, 9L, 9L, 5L, 4L, 4L, 4L, 5L, 6L, 5L]
> rxP = [77, 228, 251, 112, 77, 42, 75, 97, 147, 91]
> txP = [61, 177, 188, 90, 61, 40, 64, 76, 113, 77]
> col = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
> 
> ethPlot = pyplot
> fig = ethPlot.figure()
> host = SubplotHost(fig, 111)
> 
> host.set_ylabel("kB/s")
> host.set_xlabel("Time")
> 
> par1 = host.twinx()
> par2 = host.twinx()
> 
> par1.set_ylabel("Packets/s")
> 
> par2.axis["right"].set_visible(False)
> 
> offset = 60, 0
> new_axisline = par2.get_grid_helper().new_fixed_axis
> par2.axis["right2"] = new_axisline(loc="right",
> 				 axes=par2,
> 				 offset=offset)
> 
> par2.axis["right2"].label.set_visible(True)
> par2.axis["right2"].set_label("Collisions")
> 
> par1.set_ylim(0, 6000)
> par2.set_ylim(0, 7000)
> 
> host.axis([ dates[0], ( dates[0] + 0.041 ), -7000, 7000])
> par1.axis([ dates[0], ( dates[0] + 0.041 ), -10000, 10000])
> par2.axis([ dates[0], ( dates[0] + 0.041 ), -700, 700])
> 
> fig.add_axes(host)
> ethPlot.subplots_adjust(right=0.75)
> 
> drawRxByt, = host.plot_date(dates, rxB, 'g', tz=None, xdate=True,
> ydate=False, label="kB/s in")
> drawTxByt, = host.plot_date(dates, txB, 'b', tz=None, xdate=True,
> ydate=False, label="kB/s out")
> drawRxPaq, = par1.plot_date(dates, rxP, 'm', tz=None, xdate=True,
> ydate=False, label="packets/s in")
> drawTxPaq, = par1.plot_date(dates, txP, 'y', tz=None, xdate=True,
> ydate=False, label="packets/s out")
> drawColls, = par2.plot_date(dates, col, 'r', tz=None, xdate=True,
> ydate=False, label="collisions")
> 
> fig.autofmt_xdate()
> 
> host.set_xlabel("Time")
> host.set_ylabel("kB/s")
> par1.set_ylabel("Packets/s")
> 
> host.legend()
> 
> host.axis["left"].label.set_color(drawRxByt.get_color())
> host.axis["left"].label.set_color(drawTxByt.get_color())
> par1.axis["right"].label.set_color(drawRxPaq.get_color())
> par1.axis["right"].label.set_color(drawtxPaq.get_color())
> par2.axis["right2"].label.set_color(drawColls.get_color())
> 
> ethPlot.draw()
> pylab.savefig( './test.png', dpi=(640/8))
> 
> 
> 
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/%22Ordinal-must-be-%3E%3D-1%22-with-SuplotHost-and-dates-tp24305444p27144728.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: boriq <bo...@gm...> - 2010年01月13日 13:09:23
Hi all,
i have a plot with 2 y-axes and 1 x-axis. The mouse pointer shows the
y-coordinates of the second y-axis, but I want the mouse pointer to show the
y-coordinate of the first y-axis.
Is there a way how to switch the mouse pointer to the first y-axis?
Thanks & regards,
peter
-- 
View this message in context: http://old.nabble.com/mouse-tracking-with-two-y-axes-tp27144406p27144406.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John R. <j....@ma...> - 2010年01月13日 08:16:49
Jae-Joon Lee wrote:
> I'm afraid that there is not much I can help anymore.
> 
> Just in case, does the same error occur when my patch is not applied?
> 
> Is it an error or just a warning? If it is an error, can you post a
> full traceback? I just want to know what step causes that.
> 
> Also, are you using the usetex mode? See if turning that on and off
> make any difference.
I tried turning usetex on and it works just fine as far as I can see. 
Thanks for the help.
> 
> Regards,
> 
> -JJ
> 
From: Gökhan S. <gok...@gm...> - 2010年01月13日 02:56:20
Allright, I have another comparison.
My simple hello.ps file produced by the svn MPL vs test_idl.ps (which has a
lot plots --only for test purposes.) file produced by IDL. When I converted
the ps file to pdf (using ps2pdf tool) it gets shinier.
http://ccnworks.googlecode.com/svn/trunk/hello.ps
http://ccnworks.googlecode.com/svn/trunk/hello.pdf
http://ccnworks.googlecode.com/svn/trunk/test_idl.ps
Some technical details regarding to the files:
hello.ps
Creator: GPL Ghostscript 870 (pswrite)
Format: PS-Adobe-3.0
test_idl.ps
Creator: IDL Version 7.1 (linux x86 m32)
Format: PS-Adobe-3.0
See the formats are same. IDL's ps creator does a much better job than the
Ghostscript. (Both in terms of fonts and lines, actual frame looks nice in
both ps and pdf files.) I use Evince Document Viewer v2.28.2 to view these
files.
What could be causing this discrepancy? Is there any way to use an
alternative PS creator with MPL? or an option to increase e.g. bits per
pixel option somewhere in the configuration?
Thanks.
On Tue, Jan 12, 2010 at 2:52 PM, Gökhan Sever <gok...@gm...> wrote:
>
>
> On Tue, Jan 12, 2010 at 2:46 PM, Jae-Joon Lee <lee...@gm...>wrote:
>
>> On Mon, Jan 11, 2010 at 3:20 PM, Gökhan Sever <gok...@gm...>
>> wrote:
>> > Another thing I noted in these images, Qt4Agg produced one looks much
>> > prettier to my eyes than the PS. What could be causing the jiggly
>> rendering
>> > in the PS?
>> >
>>
>> The rendering quality of the fonts depends on a lot of things.
>> And I think your ps file itself is okay, but the rendering application
>> you use is doing a poor job. For example, convert the ps file to pdf
>> and open in the acroread (or whatever you use).
>>
>
> Yes, it did the job. Thanks for the tip. The fonts look also nicer in PDF.
> The last interesting thing in the files, the line is rendered as blue on
> PNG, however in the PS it is red.
>
>
>
>>
>> -JJ
>>
>
>
>
> --
> Gökhan
>
-- 
Gökhan
From: Nico S. <nic...@gm...> - 2010年01月12日 21:24:10
> So what is it you're trying to accomplish? Maybe there is a better way.
Well, I'm recursively iterating through the children of all objects,
starting at gcf() (and then picking up gca(), lines, axes, everything
that belongs to the plot), which is then parsed and a TikZ file is
spit out. I need the type-checking exactly when I loop through the
children of an object to be able to say "Now we have an axes object,
plot axes.".
I'm a total Python noob, so my first attempts at an implementation is
likely quite shabby:
http://win.ua.ac.be/~nschloe/other/websvn/filedetails.php?repname=matplotlib2tikz&path=%2Ftrunk%2Fmatplotlib2tikz.py
You'll find handle_children() towards the bottom of the file.
Would the type-checking as applied in there be something sensitive to
do? Also, of course, hints of *all kinds very much appreciated!
Cheers,
Nico
From: Gökhan S. <gok...@gm...> - 2010年01月12日 20:52:34
On Tue, Jan 12, 2010 at 2:46 PM, Jae-Joon Lee <lee...@gm...> wrote:
> On Mon, Jan 11, 2010 at 3:20 PM, Gökhan Sever <gok...@gm...>
> wrote:
> > Another thing I noted in these images, Qt4Agg produced one looks much
> > prettier to my eyes than the PS. What could be causing the jiggly
> rendering
> > in the PS?
> >
>
> The rendering quality of the fonts depends on a lot of things.
> And I think your ps file itself is okay, but the rendering application
> you use is doing a poor job. For example, convert the ps file to pdf
> and open in the acroread (or whatever you use).
>
Yes, it did the job. Thanks for the tip. The fonts look also nicer in PDF.
The last interesting thing in the files, the line is rendered as blue on
PNG, however in the PS it is red.
>
> -JJ
>
-- 
Gökhan
From: Jae-Joon L. <lee...@gm...> - 2010年01月12日 20:46:36
On Mon, Jan 11, 2010 at 3:20 PM, Gökhan Sever <gok...@gm...> wrote:
> Another thing I noted in these images, Qt4Agg produced one looks much
> prettier to my eyes than the PS. What could be causing the jiggly rendering
> in the PS?
>
The rendering quality of the fonts depends on a lot of things.
And I think your ps file itself is okay, but the rendering application
you use is doing a poor job. For example, convert the ps file to pdf
and open in the acroread (or whatever you use).
-JJ
From: Jae-Joon L. <lee...@gm...> - 2010年01月12日 20:37:19
I'm afraid that there is not much I can help anymore.
Just in case, does the same error occur when my patch is not applied?
Is it an error or just a warning? If it is an error, can you post a
full traceback? I just want to know what step causes that.
Also, are you using the usetex mode? See if turning that on and off
make any difference.
Regards,
-JJ
On Tue, Jan 12, 2010 at 5:29 AM, John Reid <j....@ma...> wrote:
>
>
> Jae-Joon Lee wrote:
>> When you check out the svn, please try to apply the patch attached.
>>
>> patch -p1 < ps_distiller.patch
>>
>> I hope this solves your problem.
>>
>
> Thanks again for quick response. I've got the svn version and applied
> the patch. Now I get this error (with ps.usedistiller : xpdf):
>
> ** (python2.5:5948): WARNING **: IPP request failed with status 1280
> Error: Missing or bad Type3 CharProc entry
>
> An eps file is generated but I can't open it with okular or evince.
>
> Regards,
> John.
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2010年01月12日 20:24:46
On Tue, Jan 12, 2010 at 12:21 PM, dugolo <ma...@gm...> wrote:
> Basically, I would like to put ax1 on both fig1 and fig2 without having to
> repeat all of the code for plots on ax1.
>
The Axes instances in matplotlib can only have one parent figure,
i.e., the axes cannot be shared among different figures.
But this does not necessarily imply that you have to repeat the
drawing code. Just define a function that takes an axes, or use some
control structure as suggested above.
Regards,
-JJ
From: <PH...@Ge...> - 2010年01月12日 19:24:46
> -----Original Message-----
> From: dugolo [mailto:ma...@gm...]
> Sent: Tuesday, January 12, 2010 9:21 AM
> To: mat...@li...
> Subject: [Matplotlib-users] Re using a subplot on two different figures
> 
> 
> I apologize if this has been covered, but I couldn't find it by
> searching.
> 
> I'm wondering how one might reuse a single subplot on two different
> figures.
> 
> Here's what I'm trying to do:
> 
> import matplotlib.pyplot as plt
> 
> fig1 = plt.figure()
> fig2 = plt.figure()
> ax1 = fig1.add_subplot(311)
> 
> #plot lots of stuff on ax1
> 
> # I thought maybe I could do something like this, but, of course, that
> doesn't work.
> ax2 = fig2.add_subplot(311)
> ax2 = ax1
> 
> Basically, I would like to put ax1 on both fig1 and fig2 without having
> to
> repeat all of the code for plots on ax1.
Doug,
I'm sure there's a slick, one-line way to do this. I don't know it either. As a quick work around, you could do this:
fig1 = plt.figure()
fig2 = plt.figure()
ax1 = fig1.add_subplot(311)
ax2 = fig2.add_subplot(311)
for ax in [ax1, ax2]:
	# do lots of stuff to ax
At least, that's how I would do it with my very basic MPL knowledge. Hope this wasn't obvious to you and something you were trying to avoid.
HTH,
-Paul H.
From: Renato A. <rj...@ig...> - 2010年01月12日 18:42:57
Quoting Matthias Michler on 01/08/2010 08:00 AM:
> Hi Renato,
> 
> I think you have to flip the x-axis of the left plot by for instance
> ax1 = subplot(121, xlim=(1, 0))
> and I think than hist(data, orientation='horizontal') or manually using 
> barh-plots works fine.
> 
> Kind regards,
> Matthias
Hi Matthias,
Thanks for your tip, this solved the first problem.
But it seems the approach I was trying is not as flexible as I thought
it would be.
Right now I'm trying mpl_toolkits.axes_grid.axes_divider but I still
have a problem on locating the yaxis labels in a centered format.
Anyway this is a bit out of the scope of the initial thread.
Thanks again.
Renato
From: dugolo <ma...@gm...> - 2010年01月12日 17:21:29
I apologize if this has been covered, but I couldn't find it by searching. 
I'm wondering how one might reuse a single subplot on two different figures.
Here's what I'm trying to do:
import matplotlib.pyplot as plt
fig1 = plt.figure()
fig2 = plt.figure()
ax1 = fig1.add_subplot(311)
#plot lots of stuff on ax1
# I thought maybe I could do something like this, but, of course, that
doesn't work.
ax2 = fig2.add_subplot(311)
ax2 = ax1
Basically, I would like to put ax1 on both fig1 and fig2 without having to
repeat all of the code for plots on ax1.
Thanks for the help!!!
-Doug
-- 
View this message in context: http://old.nabble.com/Reusing-a-subplot-on-two-different-figures-tp27131100p27131100.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
25 messages has been excluded from this view by a project administrator.

Showing results of 346

<< < 1 .. 8 9 10 11 12 .. 14 > >> (Page 10 of 14)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /