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
(9) |
2
(8) |
3
|
4
(6) |
5
|
6
|
7
(41) |
8
(18) |
9
(25) |
10
(18) |
11
(10) |
12
(13) |
13
(7) |
14
(4) |
15
(12) |
16
(6) |
17
(9) |
18
(7) |
19
(2) |
20
(5) |
21
(7) |
22
(2) |
23
(11) |
24
(11) |
25
(14) |
26
(3) |
27
(3) |
28
(17) |
29
(7) |
30
(16) |
31
(8) |
|
|
On Wednesday, March 9, 2011, Mads Ipsen <mad...@gm...> wrote: > Hi, > > I am using the Qt4 based back engine for displaying a 2D plot in a > widget. The plot typically contains lots of line plots. Suppose I add a > CirclePolygon to the plot like this: > > circle = CirclePolygon((x,y), radius=0.04, edgecolor='black', > facecolor='red', zorder=1) > axes.add_patch(circle) > > Then when I start to zoom in the window the aspect ratio of the circle > is not preserved (it appears like an ellipse). If you plot a line with > points, displaying its points using circles, these circles do have their > aspect ratio (and size) preserved. There must be some approach for > achieving the same effect for a manually added circle. > > Any help is appreciated, > > Best regards, > > Mads > Mads, The way this is done is tricky. The transform object assigned to the circles in plot() and scatter() are different than the default when you make a circle polygon yourself. The easiest way to get them is to just simply use scatter() and pass in your own size value. I hope that helps! Ben Root
Here is a script (below). I want the blue circle to appear as a circle with a 1:1 aspect ratio, making it look like a circle and not an ellipse. Just like the scale free circles making up the curve of the damped oscillationsn also shown in the plot. Preferably, the circle should also be scale free making it have the same size no-matter how much the plot has been zoomed. Best regards, Mads import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import CirclePolygon x = np.arange(0, 10, 0.1) y = np.exp(-x/2.) * np.sin(2*np.pi*x) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x, y, 'ro-', zorder=0) ax.set_xlim(0, 10) ax.set_ylim(-1, 1) # I want this circle to appear as a circle circle = CirclePolygon((7.5,0.0), radius=0.1, zorder=1) ax.add_patch(circle) plt.show() On 2011年03月09日 15:00, Aman Thakral wrote: > Could you provide some sample code that recreates the problem (and > shows what you're trying to accomplish)? > > On Wed, Mar 9, 2011 at 8:58 AM, Mads Ipsen <mad...@gm... > <mailto:mad...@gm...>> wrote: > > I tried that, but that will make the entire plot look very strange > if xlim = [0;100] and ylim=[-1:1]. > > What I really want to do is add a scale free aspect ratio correct > circle to the plot. Just like the circles that appear on a scatter > plot. > > Best regards, > > Mads > > > On 2011年03月09日 14:44, Aman Thakral wrote: >> Hi Mads, >> >> Did you add axis='equal' to you axes command? >> >> e.g. ax = fig.add_subplot(111, aspect='equal') >> >> >> -Aman >> >> On Wed, Mar 9, 2011 at 6:07 AM, Mads Ipsen <mad...@gm... >> <mailto:mad...@gm...>> wrote: >> >> Hi, >> >> I am using the Qt4 based back engine for displaying a 2D plot >> in a >> widget. The plot typically contains lots of line plots. >> Suppose I add a >> CirclePolygon to the plot like this: >> >> circle = CirclePolygon((x,y), radius=0.04, edgecolor='black', >> facecolor='red', zorder=1) >> axes.add_patch(circle) >> >> Then when I start to zoom in the window the aspect ratio of >> the circle >> is not preserved (it appears like an ellipse). If you plot a >> line with >> points, displaying its points using circles, these circles do >> have their >> aspect ratio (and size) preserved. There must be some >> approach for >> achieving the same effect for a manually added circle. >> >> Any help is appreciated, >> >> Best regards, >> >> Mads >> >> -- >> +--------------------------------------------------------------+ >> | Mads Ipsen, Scientific developer | >> +-------------------------------+------------------------------+ >> | QuantumWise A/S | phone: +45-29716388 | >> | Lersø Parkallé 107 | www: www.quantumwise.com >> <http://www.quantumwise.com> | >> | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... >> <mailto:mad...@gm...> | >> +-------------------------------+------------------------------+ >> >> >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> <mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- > +--------------------------------------------------------------+ > | Mads Ipsen, Scientific developer | > +-------------------------------+------------------------------+ > | QuantumWise A/S | phone: +45-29716388 | > | Lersø Parkallé 107 | www:www.quantumwise.com <http://www.quantumwise.com> | > | DK-2100 Copenhagen Ø, Denmark | email:mad...@gm... <mailto:mad...@gm...> | > +-------------------------------+------------------------------+ > > > -- +--------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +-------------------------------+------------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Lersø Parkallé 107 | www: www.quantumwise.com | | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... | +-------------------------------+------------------------------+
Could you provide some sample code that recreates the problem (and shows what you're trying to accomplish)? On Wed, Mar 9, 2011 at 8:58 AM, Mads Ipsen <mad...@gm...> wrote: > I tried that, but that will make the entire plot look very strange if xlim > = [0;100] and ylim=[-1:1]. > > What I really want to do is add a scale free aspect ratio correct circle to > the plot. Just like the circles that appear on a scatter plot. > > Best regards, > > Mads > > > On 2011年03月09日 14:44, Aman Thakral wrote: > > Hi Mads, > > Did you add axis='equal' to you axes command? > > e.g. ax = fig.add_subplot(111, aspect='equal') > > -Aman > > On Wed, Mar 9, 2011 at 6:07 AM, Mads Ipsen <mad...@gm...> wrote: > >> Hi, >> >> I am using the Qt4 based back engine for displaying a 2D plot in a >> widget. The plot typically contains lots of line plots. Suppose I add a >> CirclePolygon to the plot like this: >> >> circle = CirclePolygon((x,y), radius=0.04, edgecolor='black', >> facecolor='red', zorder=1) >> axes.add_patch(circle) >> >> Then when I start to zoom in the window the aspect ratio of the circle >> is not preserved (it appears like an ellipse). If you plot a line with >> points, displaying its points using circles, these circles do have their >> aspect ratio (and size) preserved. There must be some approach for >> achieving the same effect for a manually added circle. >> >> Any help is appreciated, >> >> Best regards, >> >> Mads >> >> -- >> +--------------------------------------------------------------+ >> | Mads Ipsen, Scientific developer | >> +-------------------------------+------------------------------+ >> | QuantumWise A/S | phone: +45-29716388 | >> | Lersø Parkallé 107 | www: www.quantumwise.com | >> | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... | >> +-------------------------------+------------------------------+ >> >> >> >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > -- > +--------------------------------------------------------------+ > | Mads Ipsen, Scientific developer | > +-------------------------------+------------------------------+ > | QuantumWise A/S | phone: +45-29716388 | > | Lersø Parkallé 107 | www: www.quantumwise.com | > | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... | > +-------------------------------+------------------------------+ > > >
I tried that, but that will make the entire plot look very strange if xlim = [0;100] and ylim=[-1:1]. What I really want to do is add a scale free aspect ratio correct circle to the plot. Just like the circles that appear on a scatter plot. Best regards, Mads On 2011年03月09日 14:44, Aman Thakral wrote: > Hi Mads, > > Did you add axis='equal' to you axes command? > > e.g. ax = fig.add_subplot(111, aspect='equal') > > > -Aman > > On Wed, Mar 9, 2011 at 6:07 AM, Mads Ipsen <mad...@gm... > <mailto:mad...@gm...>> wrote: > > Hi, > > I am using the Qt4 based back engine for displaying a 2D plot in a > widget. The plot typically contains lots of line plots. Suppose I > add a > CirclePolygon to the plot like this: > > circle = CirclePolygon((x,y), radius=0.04, edgecolor='black', > facecolor='red', zorder=1) > axes.add_patch(circle) > > Then when I start to zoom in the window the aspect ratio of the circle > is not preserved (it appears like an ellipse). If you plot a line with > points, displaying its points using circles, these circles do have > their > aspect ratio (and size) preserved. There must be some approach for > achieving the same effect for a manually added circle. > > Any help is appreciated, > > Best regards, > > Mads > > -- > +--------------------------------------------------------------+ > | Mads Ipsen, Scientific developer | > +-------------------------------+------------------------------+ > | QuantumWise A/S | phone: +45-29716388 | > | Lersø Parkallé 107 | www: www.quantumwise.com > <http://www.quantumwise.com> | > | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... > <mailto:mad...@gm...> | > +-------------------------------+------------------------------+ > > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- +--------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +-------------------------------+------------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Lersø Parkallé 107 | www: www.quantumwise.com | | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... | +-------------------------------+------------------------------+
Hi Mads, Did you add axis='equal' to you axes command? e.g. ax = fig.add_subplot(111, aspect='equal') -Aman On Wed, Mar 9, 2011 at 6:07 AM, Mads Ipsen <mad...@gm...> wrote: > Hi, > > I am using the Qt4 based back engine for displaying a 2D plot in a > widget. The plot typically contains lots of line plots. Suppose I add a > CirclePolygon to the plot like this: > > circle = CirclePolygon((x,y), radius=0.04, edgecolor='black', > facecolor='red', zorder=1) > axes.add_patch(circle) > > Then when I start to zoom in the window the aspect ratio of the circle > is not preserved (it appears like an ellipse). If you plot a line with > points, displaying its points using circles, these circles do have their > aspect ratio (and size) preserved. There must be some approach for > achieving the same effect for a manually added circle. > > Any help is appreciated, > > Best regards, > > Mads > > -- > +--------------------------------------------------------------+ > | Mads Ipsen, Scientific developer | > +-------------------------------+------------------------------+ > | QuantumWise A/S | phone: +45-29716388 | > | Lersø Parkallé 107 | www: www.quantumwise.com | > | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... | > +-------------------------------+------------------------------+ > > > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi, I am using the Qt4 based back engine for displaying a 2D plot in a widget. The plot typically contains lots of line plots. Suppose I add a CirclePolygon to the plot like this: circle = CirclePolygon((x,y), radius=0.04, edgecolor='black', facecolor='red', zorder=1) axes.add_patch(circle) Then when I start to zoom in the window the aspect ratio of the circle is not preserved (it appears like an ellipse). If you plot a line with points, displaying its points using circles, these circles do have their aspect ratio (and size) preserved. There must be some approach for achieving the same effect for a manually added circle. Any help is appreciated, Best regards, Mads -- +--------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +-------------------------------+------------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Lersø Parkallé 107 | www: www.quantumwise.com | | DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... | +-------------------------------+------------------------------+
Hi, I repeat my question, as nobody replied yet. Does anybody know the actual state of this feature? Greetings, Thorsten 2011年2月28日 Thorsten Kranz <tho...@go...>: > Hi, > > I usually plot my multichannel-EEG data using a constant offset for > each channel and then setting the channel-names as yticks on the > y-axis. > > I stumbled across > http://www.scipy.org/Cookbook/Matplotlib/MultilinePlots > where exactly this problem is addressed, and I tried the example using > transformations. Sadly, it doesn't work anymore as the > transforms-module has changed. I know that the old methods all have > new versions, so it shouldn't be too hard to get it working again, but > I have a different question. > > It is mentioned that this functionality was planned to (maybe) > encapsulate in a method plot_signal, but I didn't find it in current > mpl. Does such a method exist or was it somehow else implemented? > > Greetings, > > Thorsten >
Benjamin Root-2 wrote: > > > Note that will not change the number of ticks already established for the > axis. For that, you can use set_xticks(), which accepts a list of values > where to set the tick marks (you should probably use set_xticklabels() > after > set_xticks()). Note that you will need to have access to the axes object. > For example: > > > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.gca() # <--- the axes object I was talking about... > ax.scatter([], []) > ax.set_xticks([0.2, 0.4, 0.6, 0.8]) > ax.set_xticklabels(['A', 'B', 'C', 'D']) > plt.show() > > > > Well this just plots 2 different imagens now, one with only the axis, and the other with the data and a default axis -- View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31104901.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Win7SP1/ActivePython-2.7.1.3-win32-x86 matplotlib-1.0.1.win32-py2.7 from sourceforge I met the following with my dataset: Save emf Error: too many values to uppack Save pdf Error: Path lacks initial MOVETO Save eps: No Erro ,but cann't open it. Here is the code : import cPickle import matplotlib.pyplot as plt from matplotlib import pylab if __name__ == "__main__": x_list =[19373.599999999999, 11022.120000000003, 90037.820000000007, \ 57023.05000000001, 54658.360000000001, 50667.520000000004,\ 37177.82, 165244.79000000001, 2575.2399999999998, 2826.2399999999998] y_list = [0.0, 1172.96, 83027.377499999988, 80505.191250000003, \ 67571.089999999997, 16066.450000000001, 2806.2912500000002,\ 108459.68750000004, 0.0, 5.0800000000000001] myaxis = plt.gca() myaxis.loglog([],[],linestyle='None') myaxis.scatter(x_list,y_list,marker='x') plt.xlim( 10,pow(10,7) ) plt.ylim( 10,pow(10,8) ) plt.show()
If I think of something, I'll let you know. In the meantime, I'd like to point out the following: Nearest neighbor returns a masked interpolation point if the nearest neighbor is masked (this is just what you've already told me). If there are two equidistant neighbors, it returns the one on the "bottom". I, naively, expected it to return the unmasked one, but I suppose that this is just natural. It might be worth pointing this out in the documentation. Thanks again, Juan On 8/03/11 10:52 AM, Jeff Whitaker wrote: > On 3/7/11 2:25 PM, Juan A. Saenz wrote: >> Jeff, thanks for your reply. >> >> One situation where one might require masked nearest neighbor >> interpolation is when, on a given fixed grid, interpolating >> velocities on cell corners (B-grid) to faces (C-grid). Cells will be >> defined as either land or ocean cells, masked or un-masked >> respectively. The masked or un-masked character of cells does not >> change. Interpolating velocities from corners adjacent to masked >> cells, to cell centers on un-masked cells will require the behavior >> in question. Imagine two adjacent cells, one masked and the other >> not. The velocities on the cell corners that lie on the coast >> (adjacent to a masked and an un-masked cell) are masked. A desireable >> behavior of the interpolator would be to produce an un-masked cell >> centered velocity on the un-masked cell that uses values from >> adjacent un-masked velocity values. >> >> Thanks, >> Juan >> > > Juan: I can see why you want it in this case, but I think in general > users would expect a masked value if the nearest neighbor is masked. > In addition, I don't see how to implement it easily. How far are you > willing to go to find a nearest neighbor that is not masked? > > In short, for your use case you'll have to implement your own custom > solution. Of course, if you can show me a simple modification to the > Basemap interp function that does what you want, and can be enabled > with a kwarg, I'll reconsider. > > -Jeff > >> >> On 8/03/11 12:23 AM, Jeff Whitaker wrote: >>> On 3/7/11 5:50 AM, Jeff Whitaker wrote: >>>> On 3/6/11 8:58 PM, Juan A. Saenz wrote: >>>>> Hi, >>>>> >>>>> I use Basemap and netCDF4-python on a regular basis, and find them >>>>> very useful tools. Thank you for developing them! >>>>> >>>>> I noticed that when using basemap.interp for nearest neighbor >>>>> (order=0) the interpolation is not masked, and nearest neighbor >>>>> masked >>>>> values will be used in the interpolation. I was wondering if you >>>>> could >>>>> suggest a way to do nearest neighbor interpolation where masked are >>>>> supported, i.e. nearest neighbor values that are not masked. >>>>> >>>>> Thanks for your help, >>>>> Juan >>>>> >>>> Juan: I agree that this would be desirable behavior. Unfortunately, >>>> it's not obvious to me how to do it. I'll think about it and get back >>>> to you. (cc'ing matplotlib-users list). >>>> >>>> -Jeff >>>> >>> >>> Juan: On second thought, I'm not sure this is desirable behavior. I >>> would guess that most of the time, if a nearest neighbor is masked, >>> the user would expect the interpolation routine to return a masked >>> value. I would be interested to hear what others think. >>> >>> -Jeff >>> >> >> > >
On 03/08/2011 09:53 AM, Mark Bakker wrote: > Works great Eric. > Is this in the documentation somewhere? Probably only in the change notes and in the docstrings. http://matplotlib.sourceforge.net/_static/CHANGELOG Eric > Thanks, > Mark > > > From: Eric Firing <ef...@ha... <mailto:ef...@ha...>> > On 03/07/2011 11:51 AM, Mark Bakker wrote: > > My values on the vertical axis are large, but the range is small: > > plot([3004,3005,3006]) > > By default this plots 0,1,2 as tickmarks along the vertical axis, and > > then at the top of the vertical axis is prints "+3.005e3". > > I prefer to simply get 3004,3005,3006 at the tickmarks. > > If you are using a recent mpl, try following your plot command with > > ticklabel_format(useOffset=False) > > Eric > > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi! I would greatly appreciate if you could give me some advice. I would like to make a Cartesian axes with a polar grid shown, just as here in this example: http://matplotlib.sourceforge.net/examples/axes_grid/demo_curvelinear_grid.html I have studied this example, I don't even need ParasiteAxes, just to make those polar grid lines visible. However, I would like to control the placement and size of such an axis and axisartist.SubplotHost or Subplot don't seem to give me enough control. I want subplots of unequal sizes, like in the GridSpec examples. Normally, one can easily add axes with fixed position and sizes with the convenience method fig.add_axes() by specifying a "rect" list. How could I control the placement of such axisartist axes similarly? Thank you in advance. Kornel
2011年3月8日 Paul Anton Letnes <pau...@gm...>: > Hi! > > This simple loop: >>>> import time >>>> import pylab >>>> for i in range(100): > ... time.sleep(0.1) > ... pylab.figure() > ... > will have python use more and more memory. While this is not technically a memory leak, it becomes one in practice, if I want to create a large number of figure objects. How can I free the memory used by one or all figure objects? Your code creating many objects is not a memory leak. You can reuse figures or dispose of them calling pylab.close(). See docstrings for pylab.close and pylab.clf. Goyo
Hi! This simple loop: >>> import time >>> import pylab >>> for i in range(100): ... time.sleep(0.1) ... pylab.figure() ... will have python use more and more memory. While this is not technically a memory leak, it becomes one in practice, if I want to create a large number of figure objects. How can I free the memory used by one or all figure objects? Cheers Paul
Works great Eric. Is this in the documentation somewhere? Thanks, Mark From: Eric Firing <ef...@ha...> > On 03/07/2011 11:51 AM, Mark Bakker wrote: > > My values on the vertical axis are large, but the range is small: > > plot([3004,3005,3006]) > > By default this plots 0,1,2 as tickmarks along the vertical axis, and > > then at the top of the vertical axis is prints "+3.005e3". > > I prefer to simply get 3004,3005,3006 at the tickmarks. > > If you are using a recent mpl, try following your plot command with > > ticklabel_format(useOffset=False) > > Eric >
Pål Gunnar Ellingsen <pa...@gm...> writes: > I know there was a post on the mail liste a couple of days ago ( Bug > in `dviread.py'), but I'm not sure if this is the same error, which it > shouldn't be as I'm using the latest svn revision. Not the same error - it is showing a warning message generated by the workaround to that problem. It looks like your pdftex.map file is lacking an entry for cmr12, which doesn't make any sense. I installed TeX Live 2010 on my Mac, and I don't see this problem. Can you send me your pdftex.map file off-list? It seems to be at /usr/share/texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map on your system. -- Jouni K. Seppänen http://www.iki.fi/jks
On Tue, Mar 8, 2011 at 12:05 PM, Pål Gunnar Ellingsen <pa...@gm...>wrote: > Hi > > I'm trying to make a plot as a pdf file (or any vector format) with LaTeX fonts. I can make it output the file using show, but not with savefig (unless it is raster graphics). > > > My setup is Fedora 13 64 bit with the latest TexLive: texlive-2011-0.1.20110227.fc13.x86_64 > and matplotlib from svn, revision 8988. > > I can run tex_demo.py as it is from http://matplotlib.sourceforge.net/users/usetex.html > > > but is I change it such that instead of a png it outputs a pdf, like the example below, it crashes. > I know there was a post on the mail liste a couple of days ago ( Bug in `dviread.py'), but I'm not sure if this is the same error, which it shouldn't be as I'm using the latest svn revision. > > > Does anyone have the same problem? > > The example and debug output are shown below. > > Regards > > Pål > > Actually, I think this is the same problem as that in "Bug in `dviread.py'". The problem is that that bug was probably fixed shortly after our transition to github.com, so the svn version actually isn't the latest version of the code. Please see the documentation here (note, this documentation is still unofficial, but it should get you started): http://matplotlib.github.com/faq/installing_faq.html#install-from-git I hope that helps! Ben Root
Hello, I am trying to plot elevation data, and I am looking for recommendation on visualization of the data? My main concern is that the data I am extracting my elevation data from is coarse and there the line graphs I am producing look jagged. Is there a way to smooth the data also? Thank you Andrew
Hi I'm trying to make a plot as a pdf file (or any vector format) with LaTeX fonts. I can make it output the file using show, but not with savefig (unless it is raster graphics). My setup is Fedora 13 64 bit with the latest TexLive: texlive-2011-0.1.20110227.fc13.x86_64 and matplotlib from svn, revision 8988. I can run tex_demo.py as it is from http://matplotlib.sourceforge.net/users/usetex.html but is I change it such that instead of a png it outputs a pdf, like the example below, it crashes. I know there was a post on the mail liste a couple of days ago ( Bug in `dviread.py'), but I'm not sure if this is the same error, which it shouldn't be as I'm using the latest svn revision. Does anyone have the same problem? The example and debug output are shown below. Regards Pål Example (test.py): --------------------------- #!/usr/bin/env python import matplotlib matplotlib.use('Qt4Agg') from matplotlib import rc from numpy import arange, cos, pi from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ grid, savefig, show rc('text', usetex=True) rc('font', family='serif') figure(1, figsize=(6,4)) ax = axes([0.1, 0.1, 0.8, 0.7]) t = arange(0.0, 1.0+0.01, 0.01) s = cos(2*2*pi*t)+2 plot(t, s) xlabel(r'\textbf{time (s)}') ylabel(r'\textit{voltage (mV)}',fontsize=16) title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", fontsize=16, color='r') grid(True) savefig('tex_demo.pdf') show() -------------------------- Debug output ------ python test.py --verbose-debug-annoying : $HOME=/home/gudrun/foo_bar CONFIGDIR=/home/gudrun/foo_bar/.matplotlib matplotlib data path /export/work/foo_bar/matplotlib/lib/matplotlib/mpl-data loaded rc file /export/work/foo_bar/matplotlib/lib/matplotlib/mpl-data/matplotlibrc matplotlib version 1.1.0svn verbose.level debug-annoying interactive is False units is False platform is linux2 loaded modules: ['numpy.lib._iotools', 'xml.sax.urlparse', 'distutils', 'matplotlib.errno', 'matplotlib.matplotlib', '_bisect', 'subprocess', 'gc', 'matplotlib.tempfile', 'distutils.sysconfig', 'ctypes._endian', 'encodings.encodings', 'matplotlib.colors', 'numpy.core.numerictypes', 'numpy.testing.sys', 'numpy.core.info', 'xml', 'numpy.fft.types', 'numpy.ma.operator', 'numpy.ma.cPickle', 'struct', 'numpy.random.info', 'tempfile', 'base64', 'numpy.linalg', 'matplotlib.threading', 'numpy.testing.operator', 'imp', 'numpy.testing', 'collections', 'numpy.core.umath', 'distutils.types', 'numpy.lib.numpy', 'numpy.core.scalarmath', 'functools', 'zipimport', 'string', 'matplotlib.subprocess', 'numpy.testing.os', 'matplotlib.locale', 'numpy.lib.arraysetops', 'numpy.testing.unittest', 'numpy.lib.math', 'encodings.utf_8', 'matplotlib.__future__', 'zope', 'numpy.testing.re', 'itertools', 'numpy.version', 'numpy.lib.re', 'distutils.re', 'ctypes.os', 'numpy.core.os', 'numpy.lib.type_check', 'httplib', 'numpy.lib.__builtin__', 'signal', 'numpy.lib.types', 'numpy.lib._datasource', 'random', 'numpy.ma.extras', 'token', 'numpy.fft.fftpack_lite', 'matplotlib.cbook', 'ctypes.ctypes', 'xml.sax.xmlreader', 'numpy.__builtin__', 'dis', 'distutils.version', 'cStringIO', 'numpy.ma.core', 'numpy.numpy', 'matplotlib.StringIO', 'locale', 'numpy.add_newdocs', 'numpy.lib.getlimits', 'matplotlib.urllib2', 'syslog', 'xml.sax.saxutils', 'matplotlib.numpy', 'numpy.lib.sys', 'encodings', 'numpy.ma.itertools', 'StringIO', 'numpy.lib.io', 'abc', 'numpy.ctypes', 'numpy.testing.decorators', 'matplotlib.warnings', 'rfc822', 'matplotlib.string', 'urllib', 'matplotlib.sys', 're', 'numpy.lib._compiled_base', 'threading', 'new', 'numpy.random.mtrand', 'urllib2', 'matplotlib.cPickle', 'math', 'numpy.fft.helper', 'fcntl', 'numpy.ma.warnings', 'inspect', 'numpy.ma.inspect', 'UserDict', 'numpy.lib.function_base', 'distutils.os', 'matplotlib', 'numpy.fft.numpy', 'xml.sax.codecs', 'exceptions', 'numpy.lib.info', 'ctypes', 'numpy.lib.warnings', 'ctypes.struct', 'codecs', 'numpy.core._sort', 'numpy.os', 'paste', '_functools', '_locale', 'matplotlib.sre_constants', 'socket', 'thread', 'numpy.lib.ufunclike', 'numpy.core.memmap', 'traceback', 'numpy.core._dotblas', 'weakref', 'numpy.core._internal', 'numpy.fft.fftpack', 'opcode', 'numpy.linalg.lapack_lite', 'distutils.sys', 'os', 'marshal', 'numpy.lib.itertools', '__future__', 'matplotlib.copy', 'xml.sax.types', 'matplotlib.traceback', '_sre', 'unittest', 'numpy.core.sys', 'numpy.random', 'numpy.linalg.numpy', '__builtin__', 'numpy.lib.twodim_base', 'matplotlib.re', 'numpy.core.cPickle', 'operator', 'array', 'numpy.core.arrayprint', 'distutils.string', 'numpy.lib.arrayterator', 'select', 'ctypes._ctypes', 'ctypes.sys', 'matplotlib.datetime', 'posixpath', 'numpy.lib.financial', 'numpy.core.multiarray', 'errno', '_socket', 'binascii', 'sre_constants', 'datetime', 'numpy.ma', 'xml.sax.handler', 'os.path', 'tokenize', 'numpy.lib.stride_tricks', 'numpy.core.numpy', 'numpy', '_warnings', 'matplotlib.types', 'numpy.core.defmatrix', 'xml.sax.os', 'cPickle', 'encodings.__builtin__', 'matplotlib.xml', 'matplotlib.new', '_codecs', 'numpy.lib.operator', 'numpy.__config__', '_collections', 'matplotlib.pyparsing', 'numpy.ma.numpy', 'copy', 'numpy.core.re', '_struct', 'numpy.core.fromnumeric', 'hashlib', 'numpy.ctypeslib', 'keyword', 'numpy.lib.scimath', 'numpy.fft', 'numpy.lib', 'bisect', 'numpy.random.numpy', 'matplotlib.random', 'posix', 'encodings.aliases', 'matplotlib.fontconfig_pattern', 'fnmatch', 'sre_parse', 'abrt_exception_handler', 'pickle', 'numpy.core.ctypes', 'mimetools', 'distutils.distutils', 'copy_reg', 'sre_compile', 'xml.sax', '_hashlib', '_random', 'numpy.lib.__future__', 'site', 'numpy.lib.polynomial', 'numpy._import_tools', '__main__', 'numpy.fft.info', 'numpy.core.records', 'shutil', 'numpy.lib.cPickle', 'numpy.sys', 'matplotlib.weakref', 'xml.sax.urllib', 'matplotlib.os', 'numpy.testing.traceback', 'strop', 'numpy.testing.numpytest', 'numpy.core.numeric', 'numpy.linalg.info', 'encodings.codecs', '_abcoll', 'numpy.core', 'matplotlib.rcsetup', 'matplotlib.time', 'xml.sax._exceptions', 'genericpath', 'stat', '_ssl', 'numpy.lib.index_tricks', 'warnings', 'numpy.lib.utils', 'numpy.core.defchararray', '_ctypes', 'numpy.lib.shape_base', 'numpy.core.types', 'textwrap', 'sys', 'numpy.core.warnings', 'numpy.core.__builtin__', 'xml.sax.sys', 'numpy.lib.format', 'numpy.lib.os', 'numpy.testing.nosetester', 'types', 'numpy.lib.shutil', 'ssl', 'matplotlib.distutils', '_weakref', 'distutils.errors', 'urlparse', 'linecache', 'matplotlib.shutil', 'numpy.lib.cStringIO', 'time', 'numpy.lib.machar', 'numpy.linalg.linalg', 'numpy.testing.utils'] Using fontManager instance from /home/gudrun/foo_bar/.matplotlib/fontList.cache backend Qt4Agg version 0.9.1 Dvi: /home/gudrun/foo_bar/.matplotlib/tex.cache/03e7a0bce05f84219ebbd9b25349b054.dvi Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt find_tex_file(pncr7t.tfm): ['kpsewhich', 'pncr7t.tfm'] find_tex_file result: /usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr7t.tfm opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr7t.tfm lh=18, bc=0, ec=170, nw=33, nh=16, nd=16 find_tex_file(pncr7t.vf): ['kpsewhich', 'pncr7t.vf'] find_tex_file result: /usr/share/texlive/texmf-dist/fonts/vf/adobe/ncntrsbk/pncr7t.vf Dvi: /usr/share/texlive/texmf-dist/fonts/vf/adobe/ncntrsbk/pncr7t.vf find_tex_file(pncr8r.tfm): ['kpsewhich', 'pncr8r.tfm'] find_tex_file result: /usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr8r.tfm opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/adobe/ncntrsbk/pncr8r.tfm lh=18, bc=1, ec=255, nw=38, nh=16, nd=16 find_tex_file(pncr8r.vf): ['kpsewhich', 'pncr8r.vf'] find_tex_file result: Dvi._xxx: encountered special: Warning: missing glyph `Gamma' Dvi._xxx: encountered special: Warning: missing glyph `Delta' Dvi._xxx: encountered special: Warning: missing glyph `Theta' Dvi._xxx: encountered special: Warning: missing glyph `Lambda' Dvi._xxx: encountered special: Warning: missing glyph `Xi' Dvi._xxx: encountered special: Warning: missing glyph `Pi' Dvi._xxx: encountered special: Warning: missing glyph `Sigma' Dvi._xxx: encountered special: Warning: missing glyph `Upsilon' Dvi._xxx: encountered special: Warning: missing glyph `Phi' Dvi._xxx: encountered special: Warning: missing glyph `Psi' Dvi._xxx: encountered special: Warning: missing glyph `Omega' Dvi._xxx: encountered special: Warning: missing glyph `dotlessj' Dvi._xxx: encountered special: Warning: missing glyph `lslashslash' Dvi: /home/gudrun/foo_bar/.matplotlib/tex.cache/3751fe08829ac873c509bb548895020f.dvi Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt find_tex_file(cmr12.tfm): ['kpsewhich', 'cmr12.tfm'] find_tex_file result: /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm lh=18, bc=0, ec=127, nw=34, nh=16, nd=10 find_tex_file(cmr12.vf): ['kpsewhich', 'cmr12.vf'] find_tex_file result: find_tex_file(cmmi12.tfm): ['kpsewhich', 'cmmi12.tfm'] find_tex_file result: /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm opening tfm file /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm lh=18, bc=0, ec=127, nw=97, nh=15, nd=9 find_tex_file(cmmi12.vf): ['kpsewhich', 'cmmi12.vf'] find_tex_file result: Dvi: /home/gudrun/foo_bar/.matplotlib/tex.cache/3751fe08829ac873c509bb548895020f.dvi Dvi._xxx: encountered special: papersize=5203.43999pt,5203.43999pt Assigning font /F1 = cmr12 find_tex_file(pdftex.map): ['kpsewhich', 'pdftex.map'] find_tex_file result: /usr/share/texlive/texmf-var/fonts/map/pdftex/updmap/pdftex.map Multiple encodings for pbkdo8y = URWBookmanL-DemiBold, skipping Traceback (most recent call last): File "test", line 35, in <module> savefig('tex_demo.pdf') File "/export/work/foo_bar/matplotlib/lib/matplotlib/pyplot.py", line 363, in savefig return fig.savefig(*args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/figure.py", line 1159, in savefig self.canvas.print_figure(*args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_qt4agg.py", line 153, in print_figure FigureCanvasAgg.print_figure(self, *args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/backend_bases.py", line 1963, in print_figure **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/backend_bases.py", line 1737, in print_pdf return pdf.print_pdf(*args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_pdf.py", line 2183, in print_pdf self.figure.draw(renderer) File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/figure.py", line 873, in draw func(*args) File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/axes.py", line 1954, in draw a.draw(renderer) File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/axis.py", line 986, in draw tick.draw(renderer) File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/axis.py", line 234, in draw self.label1.draw(renderer) File "/export/work/foo_bar/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/export/work/foo_bar/matplotlib/lib/matplotlib/text.py", line 571, in draw self._fontproperties, angle) File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_pdf.py", line 1576, in draw_tex psfont = self.tex_font_mapping(dvifont.texname) File "/export/work/foo_bar/matplotlib/lib/matplotlib/backends/backend_pdf.py", line 1366, in tex_font_mapping return self.tex_font_map[texfont] File "/export/work/foo_bar/matplotlib/lib/matplotlib/dviread.py", line 673, in __getitem__ result = self._font[texname] KeyError: 'cmr12'
On Tue, Mar 8, 2011 at 4:51 AM, Andrea Crotti <and...@gm...>wrote: > Goyo <goy...@gm...> writes: > > > > > As Ben explained you need to draw first. So the usual path is: > > 1. Draw > > 2. Figure out the size of potentially problematic things (labels, > > titles...) and the space you need. > > 3. Adjust subplots or whatever needs adjustment to fit. > > 4. Draw again. > > > > Sort of weird but it works and I think it's widely used. > > > > Goyo > > Sorry if I'm annoying, but is there any example about that? > For the text I didn't find anything using bbox_patch to compute the size > and then adapt the size of it, unless I'm blind maybe it would be nice > to add in the website for the future... > > There is an example for doing something similar, but for tick labels. Hopefully this might be a good demonstration of the concept: http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels Seeing this code just reminds me just how messy it is to deal with auto-layouts... > And also if I create an object of type matplotlib.Text.text how do I > actually attach it to my current figure? > > Because a Text object is derived from Artist, I believe you can use add_artist() to attach your Text object to an axes object (I haven't tried this personally). Ben Root
Is there an easy way to draw a piece of text (or whatever) to an off-screen or off-canvas buffer, figure out the size from that, and then use that to draw to the plot? M On 3/8/11 5:51 AM, Andrea Crotti wrote: > Goyo<goy...@gm...> writes: > >> >> As Ben explained you need to draw first. So the usual path is: >> 1. Draw >> 2. Figure out the size of potentially problematic things (labels, >> titles...) and the space you need. >> 3. Adjust subplots or whatever needs adjustment to fit. >> 4. Draw again. >> >> Sort of weird but it works and I think it's widely used. >> >> Goyo > > Sorry if I'm annoying, but is there any example about that? > For the text I didn't find anything using bbox_patch to compute the size > and then adapt the size of it, unless I'm blind maybe it would be nice > to add in the website for the future... > > And also if I create an object of type matplotlib.Text.text how do I > actually attach it to my current figure? > > Thanks, > Andrea > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
With current master at git repo, I cannot reproduce this. Both test_1.eps and test_2.eps are ~4M in size. Can you check if the file size varies significantly with rc parameters ps.usedistiller? I'm not sure how text setting can affect the images. Regards, -JJ On Tue, Mar 1, 2011 at 7:23 AM, Thomas Robitaille <tho...@gm...> wrote: > Hi, > > In the following example: > > --- > > import numpy as np > > import matplotlib as mpl > mpl.use('Agg') > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(1, 1, 1) > ax.imshow(np.random.random((1024, 1024)), interpolation='nearest') > fig.savefig('test_1.eps') > > mpl.rc('text', usetex=True) > > fig = plt.figure() > ax = fig.add_subplot(1, 1, 1) > ax.imshow(np.random.random((1024, 1024)), interpolation='nearest') > fig.savefig('test_2.eps') > > --- > > the file test_2.eps is almost 6 times larger than test_1.eps, and takes much longer to draw. It looks like in the first case, the image is rendered as a bitmap (the way it should be), whereas in the second case each pixel is drawn individually as a polygon. Is this a bug? > > I am using r8988 of matplotlib. > > Thanks for any help! > > Thomas > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT data > generated by your applications, servers and devices whether physical, virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
The easiest would be using a masked array. arr = np.arange(100).reshape((10,10)) iny, inx = np.indices(arr.shape) mymask=inx+iny>=10 imshow(np.ma.array(arr, mask=mymask), cmap="gray") imshow(np.ma.array(arr, mask=~mymask), cmap="jet") However, I recommend you to use the clippath. http://matplotlib.sourceforge.net/examples/api/clippath_demo.html Regards, -JJ On Tue, Mar 8, 2011 at 6:46 PM, T J <tj...@gm...> wrote: > imshow fills an entire "unit" in the grid. I'd like to overlay two > imshow's on top of each other, but in a non-destructive manner. One > way of doing this would be to modify the behavior of imshow so that it > only fills a portion of each "unit" in the grid. For example, in the > first imshow, I'd fill everything below the diagonal and in the second > imshow, I'd fill everything above the diagonal. > > Would this type of modification to AxesImage be feasible? Or should I > just (manually) make a PolyCollection for each imshow? I'd still want > interpolations to work as expected, but where filling (or not) is > restricted to a region within the "unit". Generally, I think this > could be a nice addition to mpl, but if there is a more typical way of > visualizing two imshows on the same axis, I might try that instead. > > thanks. > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
This is a bug and I just pushed a fix to the git repo. Meanwhile, a workaround is l1, = ax2.plot(range(150),[10.]*150,color='g') l1._transformed_path = None l1._subslice = False Regards, -JJ On Tue, Mar 8, 2011 at 6:48 AM, Hatch, Sara J (343D) <Sar...@jp...> wrote: > Matlplotlib folks, > > > > I copied the demo_curvelinear_grid.py example and noticed when using the > curvelinear_test2 > > and plotting a line that had more than 100 points that the resulting line > doesn’t plot as expected. > > > > For example: > > > > Replacing > > ax2.plot(intp(np.array([0, 30]), 50), > > intp(np.array([10., 10.]), 50)) > > > > with > > ax2.plot(range(150),[10.]*150,color='g') > > ax2.plot(range(100),[5.]*100,color='r') > > > > Shows my problem. The red line with 100 points plots just fine and as > expected. The green line with 150 points doesn’t make any sense to me (I’ve > attached the output plot). The line plots at the right radial value, but > goes from 0 degrees to what looks like 14 degrees instead of 150 degrees. > > > > Is there anything in the example code or in some of the code that limits the > number of points to 100? > > > > Thanks, > > Sara > > > > Software Versions: > > Python : 2.6.5 > > matplotlib.__version__ = '1.0.0' > > > > ------------------------------------------------------------------- > Sara Jean Hatch > Inner Planet Mission Analysis Group > Guidance, Navigation, & Control Section > NASA - Jet Propulsion Laboratory > 4800 Oak Grove Drive > M/S: 301-150 > Pasadena, CA 91109 > Phone: (818) 354-8723 > ------------------------------------------------------------------- > > > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Goyo <goy...@gm...> writes: > > As Ben explained you need to draw first. So the usual path is: > 1. Draw > 2. Figure out the size of potentially problematic things (labels, > titles...) and the space you need. > 3. Adjust subplots or whatever needs adjustment to fit. > 4. Draw again. > > Sort of weird but it works and I think it's widely used. > > Goyo Sorry if I'm annoying, but is there any example about that? For the text I didn't find anything using bbox_patch to compute the size and then adapt the size of it, unless I'm blind maybe it would be nice to add in the website for the future... And also if I create an object of type matplotlib.Text.text how do I actually attach it to my current figure? Thanks, Andrea