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
(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)


Showing 21 results of 21

From: Bin Hu <bi...@la...> - 2011年03月09日 23:02:46
Hello,
Can anyone show me how to change the default font used by Matplotlib in saving figures in EPS format? Thanks.
I can change line "BitstreamVeraSans-Roman findfont" to "Helvetica findfont" in eps files to make the texts render correctly in Illustrator, but I don't want to do that every time. 
Regards,
Bin
From: Goyo <goy...@gm...> - 2011年03月09日 20:59:26
2011年3月9日 Luciano Fleischfresser <l_...@ya...>:
> [...]
> Does anybody know how to make the plot area start right at the
> beginning of data and finish right at the end, so it spans the whole x axis?
I think this should do the trick:
axes.autoscale(axis='x', tight='True')
Goyo
From: Luciano F. <l_...@ya...> - 2011年03月09日 20:20:48
Hello, i am trying to make time series plots with the date on the x axis. The 
python code I managed to
work read a .csv file with entries like 
 Date-Time,T2am,T2
11-Fev-11-14:44:56,31.2,26.8
11-Fev-11-14:59:56,33,26.9
11-Fev-11-15:14:56,28.5,27...
Here is the main part of the code
datafile = ('t2vst2.csv')
print 'loading', datafile
times, temp1, temp2 = np.loadtxt(
 datafile, delimiter=',',
 converters={0:strpdate2num('%d-%b-%y-%H:%M:%S') },
 skiprows=1, usecols=(0,1,2), unpack=True)
fig = figure()
ax = fig.add_subplot(111)
ax.plot_date(times, temp1, 'r-',linewidth=2.0)
ax.plot_date(times, temp2, 'g-',linewidth=2.0)
ax.autoscale_view()
ax.grid('True')
ylabel('Temperatura em graus Celsius')
fig.autofmt_xdate()
show()
Matplotlib chooses to plot starting on Feb 10 til Feb 20 when the data goes from
Feb 11 to Feb 17. 
Does anybody know how to make the plot area start right at the 
beginning of data and finish right at the end, so it spans the whole x axis?
Thanks in advance
From: Benjamin R. <ben...@ou...> - 2011年03月09日 19:46:26
On Wed, Mar 9, 2011 at 10:05 AM, Muffles <dan...@gm...> wrote:
>
>
>
> Benjamin Root-2 wrote:
> >
> >
> > And, without the code, I can't help you. Please include a small script
> > that
> > I can run that demonstrates the problem. I can't reproduce your bug
> based
> > on your description.
> >
> > Ben Root
> >
> >
>
> Here it is, i think this works
>
> fig=figure(figsize=(5,9))
>
> pcolor(rand(1000,60))
>
> ax = fig.gca()
> ax.set_yticks(np.arange(0, 1000, 100)) #define a legenda dos eixos
> ax.set_yticklabels([0,1,2,3,4,5,6,7,8,9,10])
> plt.axis((0,60,0,1000)) #corta os eixos
>
> cax = axes([0.93, 0.1, 0.15, 0.8]) # setup colorbar axes
> colorbar(cax=cax) # draw colorbar
>
> plt.show()
>
Try this. It is a lot cleaner:
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure(figsize=(5, 9))
ax = fig.gca()
pc = ax.pcolor(np.random.rand(1000, 60))
ax.set_yticks(np.arange(0, 1000, 100))
ax.set_yticklabels(range(11))
ax.set_xlim(0, 60)
ax.set_ylim(0, 1000)
fig.colorbar(pc)
plt.show()
I hope that helps!
Ben Root
From: Jae-Joon L. <lee...@gm...> - 2011年03月09日 16:42:15
You may use offsetbox module.
Here is an complete example. Note that the circle always has a size of
25 point and also is draggable,
Regards,
-JJ
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import CirclePolygon, Circle
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
from matplotlib.offsetbox import DrawingArea, AnnotationBbox,
DraggableAnnotation
circle_radius = 25 # in points
da = DrawingArea(width=2*circle_radius, height=2*circle_radius,
 xdescent=circle_radius, ydescent=circle_radius, clip=False)
circle = Circle((0.,0.), radius=circle_radius, zorder=1, alpha=0.5)
da.add_artist(circle)
an1 = AnnotationBbox(da,
 xy=(7.5, 0.0), xycoords='data',
 frameon=False, pad=0.,
 annotation_clip=False,
 box_alignment=(0.5, 0.5),
 )
ax.add_artist(an1)
class DraggableAnn(DraggableAnnotation):
 def finalize_offset(self):
 loc_in_canvas = self.annotation.xytext
 self.annotation.textcoords = "data"
 pos_data =
self.annotation.axes.transData.inverted().transform_point(loc_in_canvas)
 self.annotation.xytext = tuple(pos_data)
drag1 = DraggableAnn(an1, use_blit=False)
plt.show()
On Wed, Mar 9, 2011 at 11:15 PM, Mads Ipsen <mad...@gm...> wrote:
> 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.
>
>
From: Muffles <dan...@gm...> - 2011年03月09日 16:05:29
Benjamin Root-2 wrote:
> 
> 
> And, without the code, I can't help you. Please include a small script
> that
> I can run that demonstrates the problem. I can't reproduce your bug based
> on your description.
> 
> Ben Root
> 
> 
Here it is, i think this works
fig=figure(figsize=(5,9))
pcolor(rand(1000,60))
ax = fig.gca() 
ax.set_yticks(np.arange(0, 1000, 100)) #define a legenda dos eixos
ax.set_yticklabels([0,1,2,3,4,5,6,7,8,9,10])
plt.axis((0,60,0,1000)) #corta os eixos
cax = axes([0.93, 0.1, 0.15, 0.8]) # setup colorbar axes
colorbar(cax=cax) # draw colorbar
plt.show()
-- 
View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31107693.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年03月09日 15:21:20
On Wed, Mar 9, 2011 at 9:11 AM, Muffles <dan...@gm...> wrote:
>
>
>
> Benjamin Root-2 wrote:
> >
> >
> > Could you please include your code? My code was merely a
> > demonstration and not meant to be copy and pasted in it's entirety.
> >
> > Ben Root
> >
> >
>
> Thx, but I fixed that already, it was my error.
> Still dont cant fix the width of the window though...
>
And, without the code, I can't help you. Please include a small script that
I can run that demonstrates the problem. I can't reproduce your bug based
on your description.
Ben Root
From: Benjamin R. <ben...@ou...> - 2011年03月09日 15:20:50
2011年3月9日 hongleij <hon...@12...>
>
> 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()
>
>
I can confirm this bug (at least for eps and pdf files) on the master branch
as well. I have also found that it occurs even for '+' markers and for 'o'
markers. So, this problem isn't limited to just the
AsteriskPolygonCollections. It appears to be something wrong with respect
to utilizing the log scales. If I try the same code, but without log scale,
the images are valid.
Hong - just as a side note, using "loglog([], [], linestyle='None')" to
force your graph into log scale is not the right way. It is better to do:
myaxis.set_xscale('log')
myaxis.set_yscale('log')
This won't fix your problem, but at least it is better coding style.
Ben Root
From: Mads I. <mad...@gm...> - 2011年03月09日 15:13:14
Thanks.
The intention is to make the added circle dragable by the mouse by 
listening to mouse press, move, and release.
That means that I have to modify the data of the added scatter data. I 
believe that the axes.scatter() method returns a 
matplotlib.collections.CircleCollection object. How do I change the 
position of the circles (one circle) contained in this object?
Mads
On 2011年03月09日 15:28, Benjamin Root wrote:
> 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
-- 
+--------------------------------------------------------------+
| Mads Ipsen, Scientific developer |
+-------------------------------+------------------------------+
| QuantumWise A/S | phone: +45-29716388 |
| Lersø Parkallé 107 | www: www.quantumwise.com |
| DK-2100 Copenhagen Ø, Denmark | email: mad...@gm... |
+-------------------------------+------------------------------+
From: Muffles <dan...@gm...> - 2011年03月09日 15:11:23
Benjamin Root-2 wrote:
> 
> 
> Could you please include your code? My code was merely a
> demonstration and not meant to be copy and pasted in it's entirety.
> 
> Ben Root
> 
> 
Thx, but I fixed that already, it was my error.
Still dont cant fix the width of the window though...
-- 
View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31107217.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年03月09日 14:46:38
On Wednesday, March 9, 2011, Muffles <dan...@gm...> wrote:
>
>
>
> 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
Could you please include your code? My code was merely a
demonstration and not meant to be copy and pasted in it's entirety.
Ben Root
From: Benjamin R. <ben...@ou...> - 2011年03月09日 14:29:03
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
From: Mads I. <mad...@gm...> - 2011年03月09日 14:15:24
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... |
+-------------------------------+------------------------------+
From: Aman T. <ama...@gm...> - 2011年03月09日 14:01:20
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... |
> +-------------------------------+------------------------------+
>
>
>
From: Mads I. <mad...@gm...> - 2011年03月09日 13:58:31
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... |
+-------------------------------+------------------------------+
From: Aman T. <ama...@gm...> - 2011年03月09日 13:44:40
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
>
From: Mads I. <mad...@gm...> - 2011年03月09日 11:07:47
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... |
+-------------------------------+------------------------------+
From: Thorsten K. <tho...@go...> - 2011年03月09日 10:05:25
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
>
From: Muffles <dan...@gm...> - 2011年03月09日 10:03:16
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.
From: hongleij <hon...@12...> - 2011年03月09日 09:35:29
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() 
From: Juan A. S. <jua...@an...> - 2011年03月09日 04:05:57
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
>>>
>>
>>
>
>
4 messages has been excluded from this view by a project administrator.

Showing 21 results of 21

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 によって変換されたページ (->オリジナル) /