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




Showing results of 98

<< < 1 2 3 4 > >> (Page 2 of 4)
From: Adam H. <hug...@gm...> - 2014年09月22日 17:28:47
I guess I could change my API a bit to allow for data that would better fit
ax.plot3d. I suppose plot3d is really what I'm trying to make, where I'd
just pass 5 evenly spaced curves from my dataset.
If you think of a hacky solution even, can you shoot me a message?
Thanks for your help and the heads up about the graphics bugs.
On Mon, Sep 22, 2014 at 12:39 PM, Benjamin Root <ben...@ou...> wrote:
> Sorry, that isn't possible in the current design. Instead, I would suggest
> making a line plot on top of surface mimicking this. Although, depending on
> the shape of the surface, this may not work out well as mplot3d may not
> properly compose such a scene of mixed objects.
>
> Also, as a side note, be careful saving figures with zero linewidths as
> certain vector backends (e.g., pdf, ps) don't properly respect such
> linewidths. I think most of such bugs were fixed for v1.4.0, but there were
> a few additional bugs that are going into the upcoming v1.4.1 release.
>
> Cheers!
> Ben Root
>
> On Mon, Sep 22, 2014 at 12:29 PM, Adam Hughes <hug...@gm...>
> wrote:
>
>> Thanks benjamin. Not sure how I overlooked this!
>>
>> You wouldn't happen to know how to remove the cstrides while keeping the
>> rstrides in tact? By strides, I guess I don't mean strides per-se, but the
>> contour lines themselves that run over the surface.
>>
>> On Mon, Sep 22, 2014 at 9:55 AM, Benjamin Root <ben...@ou...> wrote:
>>
>>> I think you can just set the linewidth to zero like in these examples:
>>>
>>> http://matplotlib.org/examples/mplot3d/surface3d_demo.html
>>> http://matplotlib.org/examples/mplot3d/surface3d_demo3.html
>>>
>>> Cheers!
>>> Ben Root
>>>
>>> On Sat, Sep 20, 2014 at 7:44 PM, Adam Hughes <hug...@gm...>
>>> wrote:
>>>
>>>> Also, is it possible to change the stride color/opacity? Not for this
>>>> plot in particular, but for surface plots, I'd rather not have dense black
>>>> strides on my surface. Can't find the right keyword call through the 3d
>>>> API. Sorry if I'm overlooking something obvious in the docs
>>>>
>>>> On Sat, Sep 20, 2014 at 7:31 PM, Adam Hughes <hug...@gm...>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I was using wireframe to plot my spectroscopy data, and noticed if I
>>>>> choose a large R-stride, I somewhat unexpectedly get this really helpful
>>>>> evenly spaced spectral plot (attached).
>>>>>
>>>>> The only issue is that there's still the cstride connecting some of
>>>>> the peaks. I'd like to get rid of this, but it seems that at least one
>>>>> cstride is necessary. Anyone have any hacking ideas on how to get rid of
>>>>> this?
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Slashdot TV. Video for Nerds. Stuff that Matters.
>>>>
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>>
>>>
>>
>
From: Benjamin R. <ben...@ou...> - 2014年09月22日 16:39:39
Sorry, that isn't possible in the current design. Instead, I would suggest
making a line plot on top of surface mimicking this. Although, depending on
the shape of the surface, this may not work out well as mplot3d may not
properly compose such a scene of mixed objects.
Also, as a side note, be careful saving figures with zero linewidths as
certain vector backends (e.g., pdf, ps) don't properly respect such
linewidths. I think most of such bugs were fixed for v1.4.0, but there were
a few additional bugs that are going into the upcoming v1.4.1 release.
Cheers!
Ben Root
On Mon, Sep 22, 2014 at 12:29 PM, Adam Hughes <hug...@gm...>
wrote:
> Thanks benjamin. Not sure how I overlooked this!
>
> You wouldn't happen to know how to remove the cstrides while keeping the
> rstrides in tact? By strides, I guess I don't mean strides per-se, but the
> contour lines themselves that run over the surface.
>
> On Mon, Sep 22, 2014 at 9:55 AM, Benjamin Root <ben...@ou...> wrote:
>
>> I think you can just set the linewidth to zero like in these examples:
>>
>> http://matplotlib.org/examples/mplot3d/surface3d_demo.html
>> http://matplotlib.org/examples/mplot3d/surface3d_demo3.html
>>
>> Cheers!
>> Ben Root
>>
>> On Sat, Sep 20, 2014 at 7:44 PM, Adam Hughes <hug...@gm...>
>> wrote:
>>
>>> Also, is it possible to change the stride color/opacity? Not for this
>>> plot in particular, but for surface plots, I'd rather not have dense black
>>> strides on my surface. Can't find the right keyword call through the 3d
>>> API. Sorry if I'm overlooking something obvious in the docs
>>>
>>> On Sat, Sep 20, 2014 at 7:31 PM, Adam Hughes <hug...@gm...>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was using wireframe to plot my spectroscopy data, and noticed if I
>>>> choose a large R-stride, I somewhat unexpectedly get this really helpful
>>>> evenly spaced spectral plot (attached).
>>>>
>>>> The only issue is that there's still the cstride connecting some of the
>>>> peaks. I'd like to get rid of this, but it seems that at least one cstride
>>>> is necessary. Anyone have any hacking ideas on how to get rid of this?
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Slashdot TV. Video for Nerds. Stuff that Matters.
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
From: Adam H. <hug...@gm...> - 2014年09月22日 16:29:10
Thanks benjamin. Not sure how I overlooked this!
You wouldn't happen to know how to remove the cstrides while keeping the
rstrides in tact? By strides, I guess I don't mean strides per-se, but the
contour lines themselves that run over the surface.
On Mon, Sep 22, 2014 at 9:55 AM, Benjamin Root <ben...@ou...> wrote:
> I think you can just set the linewidth to zero like in these examples:
>
> http://matplotlib.org/examples/mplot3d/surface3d_demo.html
> http://matplotlib.org/examples/mplot3d/surface3d_demo3.html
>
> Cheers!
> Ben Root
>
> On Sat, Sep 20, 2014 at 7:44 PM, Adam Hughes <hug...@gm...>
> wrote:
>
>> Also, is it possible to change the stride color/opacity? Not for this
>> plot in particular, but for surface plots, I'd rather not have dense black
>> strides on my surface. Can't find the right keyword call through the 3d
>> API. Sorry if I'm overlooking something obvious in the docs
>>
>> On Sat, Sep 20, 2014 at 7:31 PM, Adam Hughes <hug...@gm...>
>> wrote:
>>
>>> Hi,
>>>
>>> I was using wireframe to plot my spectroscopy data, and noticed if I
>>> choose a large R-stride, I somewhat unexpectedly get this really helpful
>>> evenly spaced spectral plot (attached).
>>>
>>> The only issue is that there's still the cstride connecting some of the
>>> peaks. I'd like to get rid of this, but it seems that at least one cstride
>>> is necessary. Anyone have any hacking ideas on how to get rid of this?
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Slashdot TV. Video for Nerds. Stuff that Matters.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Xiaobo Y. <xia...@gm...> - 2014年09月22日 16:17:23
Hi,
I want to show some points on a world map. But the color of a point is
linked to the value at the point. Any idea why the code below does not give
what I want (same color, no legend)?
Many thanks,
Tom
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
lats = [47.8, -54.85, 47.0544, 44.18, 47.42, 46.55]
lons = [11.02, -68.32, 12.9583, 10.7, 10.98, 7.99]
scores = [4.93657698397, -31.0626756529, 35.2049971001, 23.1060270438,
12.5139213403, 17.3946319493]
map = Basemap(projection = 'mill')
map.drawcoastlines()
map.drawmapboundary()
for lat, lon, score in zip(lats, lons, scores):
 print('Score at (%f, %f) is %f' % (lat, lon, score))
 x, y = map(lon, lat) # Notice x = lon, y = lat
 map.scatter(x, y, marker = 'o',
 s = 500,
 c = score,
 cmap = plt.get_cmap('rainbow'))
plt.legend()
plt.show()
From: Benjamin R. <ben...@ou...> - 2014年09月22日 15:47:58
quite likely. To know for sure, run the following in the command-line:
python -c "import matplotlib; print matplotlib.__version__"
On Mon, Sep 22, 2014 at 11:42 AM, Gabriele Brambilla <
gb....@gm...> wrote:
> If it returns this means that I have an older version?
>
> Traceback (most recent call last):
> File "dataMODEL.py", line 99, in <module>
> ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='b',
> marker='o
> ', depthshade=False)
> File "C:\Anaconda\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py",
> line 2180
> , in scatter
> patches = Axes.scatter(self, xs, ys, s=s, c=c, *args, **kwargs)
> File "C:\Anaconda\lib\site-packages\matplotlib\axes.py", line 6312, in
> scatter
>
> collection.update(kwargs)
> File "C:\Anaconda\lib\site-packages\matplotlib\artist.py", line 739, in
> update
>
> raise AttributeError('Unknown property %s' % k)
> AttributeError: Unknown property depthshade
>
>
> 2014年09月22日 17:27 GMT+02:00 Benjamin Root <ben...@ou...>:
>
>> As of version 1.4.0, the 3d scatter plotting function gained the
>> "depthshade" argument that you can set to false.
>>
>> http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#scatter-plots
>>
>> Cheers!
>> Ben Root
>>
>> On Mon, Sep 22, 2014 at 11:18 AM, Gabriele Brambilla <
>> gb....@gm...> wrote:
>>
>>> Hi I'm trying to use a 3d scatter plot.
>>>
>>> import matplotlib.pyplot as plt
>>> from mpl_toolkits.mplot3d import Axes3D
>>> import matplotlib.pyplot as plt
>>> from matplotlib import cm
>>>
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111, projection='3d')
>>> ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='k')
>>> ax.scatter(np.log10(NPd), np.log10(NBd), np.log10(NLd), c='b')
>>>
>>> I would like that the dots that appear are all of the same color not in
>>> shades of black ('k') or shades of blue ('b') but I don't know how to do it.
>>>
>>> thanks
>>>
>>> Gabriele
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
From: Gabriele B. <gb....@gm...> - 2014年09月22日 15:43:07
If it returns this means that I have an older version?
Traceback (most recent call last):
 File "dataMODEL.py", line 99, in <module>
 ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='b',
marker='o
', depthshade=False)
 File "C:\Anaconda\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line
2180
, in scatter
 patches = Axes.scatter(self, xs, ys, s=s, c=c, *args, **kwargs)
 File "C:\Anaconda\lib\site-packages\matplotlib\axes.py", line 6312, in
scatter
 collection.update(kwargs)
 File "C:\Anaconda\lib\site-packages\matplotlib\artist.py", line 739, in
update
 raise AttributeError('Unknown property %s' % k)
AttributeError: Unknown property depthshade
2014年09月22日 17:27 GMT+02:00 Benjamin Root <ben...@ou...>:
> As of version 1.4.0, the 3d scatter plotting function gained the
> "depthshade" argument that you can set to false.
>
> http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#scatter-plots
>
> Cheers!
> Ben Root
>
> On Mon, Sep 22, 2014 at 11:18 AM, Gabriele Brambilla <
> gb....@gm...> wrote:
>
>> Hi I'm trying to use a 3d scatter plot.
>>
>> import matplotlib.pyplot as plt
>> from mpl_toolkits.mplot3d import Axes3D
>> import matplotlib.pyplot as plt
>> from matplotlib import cm
>>
>> fig = plt.figure()
>> ax = fig.add_subplot(111, projection='3d')
>> ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='k')
>> ax.scatter(np.log10(NPd), np.log10(NBd), np.log10(NLd), c='b')
>>
>> I would like that the dots that appear are all of the same color not in
>> shades of black ('k') or shades of blue ('b') but I don't know how to do it.
>>
>> thanks
>>
>> Gabriele
>>
>>
>> ------------------------------------------------------------------------------
>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Benjamin R. <ben...@ou...> - 2014年09月22日 15:27:51
As of version 1.4.0, the 3d scatter plotting function gained the
"depthshade" argument that you can set to false.
http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#scatter-plots
Cheers!
Ben Root
On Mon, Sep 22, 2014 at 11:18 AM, Gabriele Brambilla <
gb....@gm...> wrote:
> Hi I'm trying to use a 3d scatter plot.
>
> import matplotlib.pyplot as plt
> from mpl_toolkits.mplot3d import Axes3D
> import matplotlib.pyplot as plt
> from matplotlib import cm
>
> fig = plt.figure()
> ax = fig.add_subplot(111, projection='3d')
> ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='k')
> ax.scatter(np.log10(NPd), np.log10(NBd), np.log10(NLd), c='b')
>
> I would like that the dots that appear are all of the same color not in
> shades of black ('k') or shades of blue ('b') but I don't know how to do it.
>
> thanks
>
> Gabriele
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Gabriele B. <gb....@gm...> - 2014年09月22日 15:18:45
Hi I'm trying to use a 3d scatter plot.
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='k')
ax.scatter(np.log10(NPd), np.log10(NBd), np.log10(NLd), c='b')
I would like that the dots that appear are all of the same color not in
shades of black ('k') or shades of blue ('b') but I don't know how to do it.
thanks
Gabriele
From: Benjamin R. <ben...@ou...> - 2014年09月22日 14:01:19
In the example you provided, you tried to broadcase two 1D arrays against
each other, which isn't what you want because all you will get is another
1-D array. Broadcasting automatically repeats data for you along a
dimension. It is rare to actually call np.broadcast() as it usually happens
automatically. Perhaps you should take your questions about broadcasting
over to the numpy discussion mailing list where somebody there might be
able to better explain it than I.
Cheers!
Ben Root
On Mon, Sep 22, 2014 at 6:42 AM, Raffaele Quarta <raf...@li...
> wrote:
> Hi all,
>
> somebody can show me with an example how can I set the numpy's
> broadcasting feature?
>
> Actually, I'm using 'meshgrid' in the script but I knew that it takes a
> lot of time to have the plot.
>
> Thank you.
>
> Raf
>
>
>
> -----Original Message-----
> From: Raffaele Quarta [mailto:raf...@li...
> <raf...@li...>]
> Sent: Tue 9/9/2014 3:55 PM
> To: Benjamin Root; Ryan Nelson
> Cc: Matplotlib Users
> Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
>
> Hi Ben and Ryan,
>
> I will try to figure out as it works.
>
> Thank you.
>
> Regards,
>
> Raf
>
>
> -----Original Message-----
> From: ben...@gm... on behalf of Benjamin Root
> Sent: Tue 9/9/2014 3:25 PM
> To: Ryan Nelson
> Cc: Raffaele Quarta; Matplotlib Users
> Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
>
> Most of the time, you will not need to use meshgrid. Take advantage of
> numpy's broadcasting feature:
> http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
> It saves *significantly* on memory and processing time. Most of
> Matplotlib's plotting functions work well with broadcastable inputs, so
> that is a great way to save on memory. NumPy's ogrid is also a neat tool
> for generating broadcastable grids.
>
> When I get a chance, I'll look through the script for any other obvious
> savers.
>
> Cheers!
> Ben Root
>
>
> On Tue, Sep 9, 2014 at 9:02 AM, Ryan Nelson <rne...@gm...> wrote:
>
> > Raffaele,
> >
> > As Ben pointed out, you might be creating a lot of in memory Numpy arrays
> > that you probably don't need/want.
> >
> > For example, I think (?) slicing all of the variable below:
> > lons = fh.variables['lon'][:]
> > is making a copy of all that (mmap'ed) data as a Numpy array in memory.
> > Get rid of the slice ([:]). Of course, these variables are not Numpy
> > arrays, so you'll have to change some of your code. For example:
> > lon_0 = lons.mean()
> > Will have to become:
> > lon_0 = np.mean( lons )
> >
> > If lats and lons are very large sets of data, then meshgrid will make two
> > very, very large arrays in memory.
> > For example, try this:
> > np.meshgrid(np.arange(5), np.arange(5))
> > The output is two much larger arrays:
> > [array([[0, 1, 2, 3, 4],
> > [0, 1, 2, 3, 4],
> > [0, 1, 2, 3, 4],
> > [0, 1, 2, 3, 4],
> > [0, 1, 2, 3, 4]]),
> > array([[0, 0, 0, 0, 0],
> > [1, 1, 1, 1, 1],
> > [2, 2, 2, 2, 2],
> > [3, 3, 3, 3, 3],
> > [4, 4, 4, 4, 4]])]
> > I don't know Basemap at all, so I don't know if this is necessary. You
> > might be able to force the meshgrid output into a memmap file, but I
> don't
> > know how to do that right now. Perhaps someone else has some suggestions.
> >
> > Hope that helps.
> >
> > Ryan
> >
> >
> >
> >
> > On Tue, Sep 9, 2014 at 4:07 AM, Raffaele Quarta <
> > raf...@li...> wrote:
> >
> >> Hi Jody and Ben,
> >>
> >> thanks for your answers.
> >> I tried to use pcolormesh instead of pcolor and the result is very good!
> >> For what concern with the memory system problem, I wasn't able to solve
> it.
> >> When I tried to use the bigger file, I got the same problem. Attached
> you
> >> will find the script that I'm using to make the plot. May be, I didn't
> >> understand very well how can I use the mmap function.
> >>
> >> Regards,
> >>
> >> Raffaele.
> >>
> >>
> >> -----Original Message-----
> >> From: Jody Klymak [mailto:jk...@uv... <jk...@uv...> <
> jk...@uv...>]
> >> Sent: Mon 9/8/2014 5:46 PM
> >> To: Benjamin Root
> >> Cc: Raffaele Quarta; Matplotlib Users
> >> Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
> >>
> >> It looks like you are calling `pcolor`. Can I suggest you try
> >> `pcolormesh`? ii
> >>
> >> 75 Mb is not a big file!
> >>
> >> Cheers, Jody
> >>
> >>
> >> On Sep 8, 2014, at 7:38 AM, Benjamin Root <ben...@ou...> wrote:
> >>
> >> > (Keeping this on the mailing list so that others can benefit)
> >> >
> >> > What might be happening is that you are keeping around too many numpy
> >> arrays in memory than you actually need. Take advantage of memmapping,
> >> which most netcdf tools provide by default. This keeps the data on disk
> >> rather than in RAM. Second, for very large images, I would suggest
> either
> >> pcolormesh() or just simply imshow() instead of pcolor() as they are
> more
> >> way more efficient than pcolor(). In addition, it sounds like you are
> >> dealing with re-sampled data ("at different zoom levels"). Does this
> mean
> >> that you are re-running contour on re-sampled data? I am not sure what
> the
> >> benefit of doing that is if one could just simply do the contour once at
> >> the highest resolution.
> >> >
> >> > Without seeing any code, though, I can only provide generic
> suggestions.
> >> >
> >> > Cheers!
> >> > Ben Root
> >> >
> >> >
> >> > On Mon, Sep 8, 2014 at 10:12 AM, Raffaele Quarta <
> >> raf...@li...> wrote:
> >> > Hi Ben,
> >> >
> >> > sorry for the few details that I gave to you. I'm trying to make a
> >> contour plot of a variable at different zoom levels by using high
> >> resolution data. The aim is to obtain .PNG output images. Actually, I'm
> >> working with big data (NetCDF file, dimension is about 75Mb). The
> current
> >> Matplotlib version on my UBUNTU 14.04 machine is the 1.3.1 one. My
> system
> >> has a RAM capacity of 8Gb.
> >> > Actually, I'm dealing with memory system problems when I try to make a
> >> plot. I got the error message as follow:
> >> >
> >> > --------------------------------------------
> >> > cs = m.pcolor(xi,yi,np.squeeze(t))
> >> > File
> "/usr/lib/pymodules/python2.7/mpl_toolkits/basemap/__init__.py",
> >> line 521, in with_transform
> >> > return plotfunc(self,x,y,data,*args,**kwargs)
> >> > File
> "/usr/lib/pymodules/python2.7/mpl_toolkits/basemap/__init__.py",
> >> line 3375, in pcolor
> >> > x = ma.masked_values(np.where(x > 1.e20,1.e20,x), 1.e20)
> >> > File "/usr/lib/python2.7/dist-packages/numpy/ma/core.py", line 2195,
> >> in masked_values
> >> > condition = umath.less_equal(mabs(xnew - value), atol + rtol *
> >> mabs(value))
> >> > MemoryError
> >> > --------------------------------------------
> >> >
> >> > Otherwise, when I try to make a plot of smaller file (such as 5Mb), it
> >> works very well. I believe that it's not something of wrong in the
> script.
> >> It might be a memory system problem.
> >> > I hope that my message is more clear now.
> >> >
> >> > Thanks for the help.
> >> >
> >> > Regards,
> >> >
> >> > Raffaele
> >> >
> >> > -----------------------------------------
> >> >
> >> > Sent: Mon 9/8/2014 3:19 PM
> >> > To: Raffaele Quarta
> >> > Cc: Matplotlib Users
> >> > Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
> >> >
> >> >
> >> >
> >> > You will need to be more specific... much more specific. What kind of
> >> plot
> >> > are you making? How big is your data? What version of matplotlib are
> you
> >> > using? How much RAM do you have available compared to the amount of
> data
> >> > (most slowdowns are actually due to swap-thrashing issues). Matplotlib
> >> can
> >> > be used for large data, but there exists some speciality tools for the
> >> > truly large datasets. The solution depends on the situation.
> >> >
> >> > Ben Root
> >> >
> >> > On Mon, Sep 8, 2014 at 7:45 AM, Raffaele Quarta <
> >> raf...@li...>
> >> > wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > I'm working with NetCDF format. When I try to make a plot of very
> >> large
> >> > > file, I have to wait for a long time for plotting. How can I solve
> >> this?
> >> > > Isn't there a solution for this problem?
> >> > >
> >> > > Raffaele
> >> > >
> >> > > --
> >> > > This email was Virus checked by Astaro Security Gateway.
> >> http://www.sophos.com
> >> > >
> >> > >
> >> > >
> >> > >
> >>
> ------------------------------------------------------------------------------
> >> > > Want excitement?
> >> > > Manually upgrade your production database.
> >> > > When you want reliability, choose Perforce
> >> > > Perforce version control. Predictably reliable.
> >> > >
> >> > >
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> >> > > _______________________________________________
> >> > > Matplotlib-users mailing list
> >> > > Mat...@li...
> >> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >> > >
> >> > >
> >> >
> >> > --
> >> > This email was Virus checked by Astaro Security Gateway.
> >> http://www.sophos.com
> >> >
> >> >
> >> >
> >> >
> >>
> ------------------------------------------------------------------------------
> >> > Want excitement?
> >> > Manually upgrade your production database.
> >> > When you want reliability, choose Perforce
> >> > Perforce version control. Predictably reliable.
> >> >
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk_______________________________________________
> >> > Matplotlib-users mailing list
> >> > Mat...@li...
> >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >>
> >> --
> >> Jody Klymak
> >> http://web.uvic.ca/~jklymak/
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Want excitement?
> >> Manually upgrade your production database.
> >> When you want reliability, choose Perforce.
> >> Perforce version control. Predictably reliable.
> >>
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Matplotlib-users mailing list
> >> Mat...@li...
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >>
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Want excitement?
> > Manually upgrade your production database.
> > When you want reliability, choose Perforce.
> > Perforce version control. Predictably reliable.
> >
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
>
>
> --
> This email was Virus checked by Astaro Security Gateway.
> http://www.sophos.com
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Benjamin R. <ben...@ou...> - 2014年09月22日 13:55:34
I think you can just set the linewidth to zero like in these examples:
http://matplotlib.org/examples/mplot3d/surface3d_demo.html
http://matplotlib.org/examples/mplot3d/surface3d_demo3.html
Cheers!
Ben Root
On Sat, Sep 20, 2014 at 7:44 PM, Adam Hughes <hug...@gm...> wrote:
> Also, is it possible to change the stride color/opacity? Not for this
> plot in particular, but for surface plots, I'd rather not have dense black
> strides on my surface. Can't find the right keyword call through the 3d
> API. Sorry if I'm overlooking something obvious in the docs
>
> On Sat, Sep 20, 2014 at 7:31 PM, Adam Hughes <hug...@gm...>
> wrote:
>
>> Hi,
>>
>> I was using wireframe to plot my spectroscopy data, and noticed if I
>> choose a large R-stride, I somewhat unexpectedly get this really helpful
>> evenly spaced spectral plot (attached).
>>
>> The only issue is that there's still the cstride connecting some of the
>> peaks. I'd like to get rid of this, but it seems that at least one cstride
>> is necessary. Anyone have any hacking ideas on how to get rid of this?
>>
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV. Video for Nerds. Stuff that Matters.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Raffaele Q. <raf...@li...> - 2014年09月22日 10:43:47
Hi all,
somebody can show me with an example how can I set the numpy's broadcasting feature?
Actually, I'm using 'meshgrid' in the script but I knew that it takes a lot of time to have the plot.
Thank you.
Raf
-----Original Message-----
From: Raffaele Quarta [mailto:raf...@li...]
Sent: Tue 9/9/2014 3:55 PM
To: Benjamin Root; Ryan Nelson
Cc: Matplotlib Users
Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
 
Hi Ben and Ryan,
I will try to figure out as it works. 
Thank you.
Regards, 
Raf
-----Original Message-----
From: ben...@gm... on behalf of Benjamin Root
Sent: Tue 9/9/2014 3:25 PM
To: Ryan Nelson
Cc: Raffaele Quarta; Matplotlib Users
Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
 
Most of the time, you will not need to use meshgrid. Take advantage of
numpy's broadcasting feature:
http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
It saves *significantly* on memory and processing time. Most of
Matplotlib's plotting functions work well with broadcastable inputs, so
that is a great way to save on memory. NumPy's ogrid is also a neat tool
for generating broadcastable grids.
When I get a chance, I'll look through the script for any other obvious
savers.
Cheers!
Ben Root
On Tue, Sep 9, 2014 at 9:02 AM, Ryan Nelson <rne...@gm...> wrote:
> Raffaele,
>
> As Ben pointed out, you might be creating a lot of in memory Numpy arrays
> that you probably don't need/want.
>
> For example, I think (?) slicing all of the variable below:
> lons = fh.variables['lon'][:]
> is making a copy of all that (mmap'ed) data as a Numpy array in memory.
> Get rid of the slice ([:]). Of course, these variables are not Numpy
> arrays, so you'll have to change some of your code. For example:
> lon_0 = lons.mean()
> Will have to become:
> lon_0 = np.mean( lons )
>
> If lats and lons are very large sets of data, then meshgrid will make two
> very, very large arrays in memory.
> For example, try this:
> np.meshgrid(np.arange(5), np.arange(5))
> The output is two much larger arrays:
> [array([[0, 1, 2, 3, 4],
> [0, 1, 2, 3, 4],
> [0, 1, 2, 3, 4],
> [0, 1, 2, 3, 4],
> [0, 1, 2, 3, 4]]),
> array([[0, 0, 0, 0, 0],
> [1, 1, 1, 1, 1],
> [2, 2, 2, 2, 2],
> [3, 3, 3, 3, 3],
> [4, 4, 4, 4, 4]])]
> I don't know Basemap at all, so I don't know if this is necessary. You
> might be able to force the meshgrid output into a memmap file, but I don't
> know how to do that right now. Perhaps someone else has some suggestions.
>
> Hope that helps.
>
> Ryan
>
>
>
>
> On Tue, Sep 9, 2014 at 4:07 AM, Raffaele Quarta <
> raf...@li...> wrote:
>
>> Hi Jody and Ben,
>>
>> thanks for your answers.
>> I tried to use pcolormesh instead of pcolor and the result is very good!
>> For what concern with the memory system problem, I wasn't able to solve it.
>> When I tried to use the bigger file, I got the same problem. Attached you
>> will find the script that I'm using to make the plot. May be, I didn't
>> understand very well how can I use the mmap function.
>>
>> Regards,
>>
>> Raffaele.
>>
>>
>> -----Original Message-----
>> From: Jody Klymak [mailto:jk...@uv... <jk...@uv...>]
>> Sent: Mon 9/8/2014 5:46 PM
>> To: Benjamin Root
>> Cc: Raffaele Quarta; Matplotlib Users
>> Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
>>
>> It looks like you are calling `pcolor`. Can I suggest you try
>> `pcolormesh`? ii
>>
>> 75 Mb is not a big file!
>>
>> Cheers, Jody
>>
>>
>> On Sep 8, 2014, at 7:38 AM, Benjamin Root <ben...@ou...> wrote:
>>
>> > (Keeping this on the mailing list so that others can benefit)
>> >
>> > What might be happening is that you are keeping around too many numpy
>> arrays in memory than you actually need. Take advantage of memmapping,
>> which most netcdf tools provide by default. This keeps the data on disk
>> rather than in RAM. Second, for very large images, I would suggest either
>> pcolormesh() or just simply imshow() instead of pcolor() as they are more
>> way more efficient than pcolor(). In addition, it sounds like you are
>> dealing with re-sampled data ("at different zoom levels"). Does this mean
>> that you are re-running contour on re-sampled data? I am not sure what the
>> benefit of doing that is if one could just simply do the contour once at
>> the highest resolution.
>> >
>> > Without seeing any code, though, I can only provide generic suggestions.
>> >
>> > Cheers!
>> > Ben Root
>> >
>> >
>> > On Mon, Sep 8, 2014 at 10:12 AM, Raffaele Quarta <
>> raf...@li...> wrote:
>> > Hi Ben,
>> >
>> > sorry for the few details that I gave to you. I'm trying to make a
>> contour plot of a variable at different zoom levels by using high
>> resolution data. The aim is to obtain .PNG output images. Actually, I'm
>> working with big data (NetCDF file, dimension is about 75Mb). The current
>> Matplotlib version on my UBUNTU 14.04 machine is the 1.3.1 one. My system
>> has a RAM capacity of 8Gb.
>> > Actually, I'm dealing with memory system problems when I try to make a
>> plot. I got the error message as follow:
>> >
>> > --------------------------------------------
>> > cs = m.pcolor(xi,yi,np.squeeze(t))
>> > File "/usr/lib/pymodules/python2.7/mpl_toolkits/basemap/__init__.py",
>> line 521, in with_transform
>> > return plotfunc(self,x,y,data,*args,**kwargs)
>> > File "/usr/lib/pymodules/python2.7/mpl_toolkits/basemap/__init__.py",
>> line 3375, in pcolor
>> > x = ma.masked_values(np.where(x > 1.e20,1.e20,x), 1.e20)
>> > File "/usr/lib/python2.7/dist-packages/numpy/ma/core.py", line 2195,
>> in masked_values
>> > condition = umath.less_equal(mabs(xnew - value), atol + rtol *
>> mabs(value))
>> > MemoryError
>> > --------------------------------------------
>> >
>> > Otherwise, when I try to make a plot of smaller file (such as 5Mb), it
>> works very well. I believe that it's not something of wrong in the script.
>> It might be a memory system problem.
>> > I hope that my message is more clear now.
>> >
>> > Thanks for the help.
>> >
>> > Regards,
>> >
>> > Raffaele
>> >
>> > -----------------------------------------
>> >
>> > Sent: Mon 9/8/2014 3:19 PM
>> > To: Raffaele Quarta
>> > Cc: Matplotlib Users
>> > Subject: Re: [Matplotlib-users] Plotting large file (NetCDF)
>> >
>> >
>> >
>> > You will need to be more specific... much more specific. What kind of
>> plot
>> > are you making? How big is your data? What version of matplotlib are you
>> > using? How much RAM do you have available compared to the amount of data
>> > (most slowdowns are actually due to swap-thrashing issues). Matplotlib
>> can
>> > be used for large data, but there exists some speciality tools for the
>> > truly large datasets. The solution depends on the situation.
>> >
>> > Ben Root
>> >
>> > On Mon, Sep 8, 2014 at 7:45 AM, Raffaele Quarta <
>> raf...@li...>
>> > wrote:
>> >
>> > > Hi,
>> > >
>> > > I'm working with NetCDF format. When I try to make a plot of very
>> large
>> > > file, I have to wait for a long time for plotting. How can I solve
>> this?
>> > > Isn't there a solution for this problem?
>> > >
>> > > Raffaele
>> > >
>> > > --
>> > > This email was Virus checked by Astaro Security Gateway.
>> http://www.sophos.com
>> > >
>> > >
>> > >
>> > >
>> ------------------------------------------------------------------------------
>> > > Want excitement?
>> > > Manually upgrade your production database.
>> > > When you want reliability, choose Perforce
>> > > Perforce version control. Predictably reliable.
>> > >
>> > >
>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>> > > _______________________________________________
>> > > Matplotlib-users mailing list
>> > > Mat...@li...
>> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> > >
>> > >
>> >
>> > --
>> > This email was Virus checked by Astaro Security Gateway.
>> http://www.sophos.com
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Want excitement?
>> > Manually upgrade your production database.
>> > When you want reliability, choose Perforce
>> > Perforce version control. Predictably reliable.
>> >
>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk_______________________________________________
>> > Matplotlib-users mailing list
>> > Mat...@li...
>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>> --
>> Jody Klymak
>> http://web.uvic.ca/~jklymak/
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Want excitement?
>> Manually upgrade your production database.
>> When you want reliability, choose Perforce.
>> Perforce version control. Predictably reliable.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce.
> Perforce version control. Predictably reliable.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
This email was Virus checked by Astaro Security Gateway. http://www.sophos.com
On 2014年09月21日, 6:07 AM, Petar Bakalov wrote:
> Using python 2.7.5 and matplotlib 1.4.0 on mac OSX 10.8.5.
>
> The output of the following snippet:
>
> |import matplotlib.pyplotas plt
> plt.ion()
> print "Is interactive:?", plt.isinteractive()
> |
>
> when ran from shell ($ python snippet.py) is:
>
> Is interactive? : 0
>
> i.e. interactive mode does not work.
>
> I think that this is not the expected behaviour. How can this be fixed?
This is under discussion here: 
https://github.com/matplotlib/matplotlib/issues/3505
Eric
>
> The same code produces
>
> Is interactive? : 1
>
> (i.e. works fine) when ran in an interactive python terminal on the same
> machine.
>
> I installed python using brew and matplotlib using pip.
>
> Best regards,
> Petar
>
> 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013;
> root:xnu-20504812~1/RELEASE_X86_64 x86_64
>
>
> ------------------------------------------------------------------------------
> Slashdot TV. Video for Nerds. Stuff that Matters.
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
Using python 2.7.5 and matplotlib 1.4.0 on mac OSX 10.8.5.
The output of the following snippet:
import matplotlib.pyplot as pltplt.ion()print "Is interactive:?",
plt.isinteractive()
when ran from shell ($ python snippet.py) is:
Is interactive? : 0
i.e. interactive mode does not work.
I think that this is not the expected behaviour. How can this be fixed?
The same code produces
Is interactive? : 1
(i.e. works fine) when ran in an interactive python terminal on the same
machine.
I installed python using brew and matplotlib using pip.
Best regards,
Petar
12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013;
root:xnu-20504812~1/RELEASE_X86_64 x86_64
From: Adam H. <hug...@gm...> - 2014年09月20日 23:44:54
Also, is it possible to change the stride color/opacity? Not for this plot
in particular, but for surface plots, I'd rather not have dense black
strides on my surface. Can't find the right keyword call through the 3d
API. Sorry if I'm overlooking something obvious in the docs
On Sat, Sep 20, 2014 at 7:31 PM, Adam Hughes <hug...@gm...> wrote:
> Hi,
>
> I was using wireframe to plot my spectroscopy data, and noticed if I
> choose a large R-stride, I somewhat unexpectedly get this really helpful
> evenly spaced spectral plot (attached).
>
> The only issue is that there's still the cstride connecting some of the
> peaks. I'd like to get rid of this, but it seems that at least one cstride
> is necessary. Anyone have any hacking ideas on how to get rid of this?
>
From: garyr <ga...@fi...> - 2014年09月20日 13:41:45
I would like to place a mathematical symbol on a plot by using the appropriate 
code bracketed by dollar signs, e.g., $\alpha$. This is the technique used in 
the program pyplot_mathtext.py described at 
http://matplotlib.org/users/mathtext.html#mathtext-tutorial. When I run this 
probram I get the error messages shown below. What do I need to do to fix this 
problem? I'm using matplotlib 1.3.1 and Python 2.6.
>python pyplot_mathtext.py
Exception in Tkinter callback
Traceback (most recent call last):
 File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
 return self.func(*args)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 276, in resize
 self.show()
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 348, in draw
 FigureCanvasAgg.draw(self)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", line
451, in draw
 self.figure.draw(self.renderer)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 1034, in draw
 func(*args)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 2086, in draw
 a.draw(renderer)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\text.py", line 547, in draw
 bbox, info, descent = self._get_layout(renderer)
 File "C:\Python26\lib\site-packages\matplotlib\text.py", line 329, in
_get_layout
 ismath=ismath)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", line
210, in get_text_width_height_descent
 self.mathtext_parser.parse(s, self.dpi, prop)
 File "C:\Python26\lib\site-packages\matplotlib\mathtext.py", line 3009, in
parse
 self.__class__._parser = Parser()
 File "C:\Python26\lib\site-packages\matplotlib\mathtext.py", line 2193, in
__init__
 - ((lbrace + float_literal + rbrace)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
>Exit code: 0
From: Jesper Baasch-L. <jes...@gm...> - 2014年09月19日 16:00:12
Hi Ryan,
Thanks for the insights. Your subclassing suggestions sounds fine to me.
Best regards,
Jesper
> Den 17/09/2014 kl. 21.49 skrev Ryan May <rm...@gm...>:
> 
> Jesper,
> 
> For performance reasons, what _make_barbs() does is create a (almost degenerate) polygon for each wind barb in the data set. The barbs are drawn such that y is along the barb, and x is perpendicular to the barb; the barb is then rotated as appropriate. The first point in the polygon is IIRC the tip of the barb, so all that would be needed is to add a few points at the beginning of the polygon to draw an arrow head shapee. Of course, all of this is deep implementation detail, subject to change in the future, but subclassing the Barbs class and overriding the _make_barbs() method should be relatively ok. (I'd start with a copy of _make_barbs() and tweak as necessary)
> 
> Ryan
> 
>> On Wed, Sep 17, 2014 at 6:29 AM, Jesper Larsen <jes...@gm...> wrote:
>> Hi matplotlib users
>> 
>> I am developing an application for showing weather forecasts using matplotlib. We use wind barbs for displaying wind forecasts:
>> 
>> http://api.fcoo.dk/ifm-maps/greenland/?zoom=6&lat=62&lon=-45&layer=FCOO%20Standard&overlays=TTFFFFFFFFFFFFFFF
>> 
>> This is fine for our "power users". We do however also have some users who are not used to wind barbs. I have elsewhere seen people put a small arrow head at the foot of the wind barbs to make it more clear which direction the wind blows toward.
>> 
>> As far as I can see from the matplotlib quiver.py code this is not possible with matplotlib. But the _make_barbs method does not seem that complicated so I wondered if it is something that I can do myself. I have however never used the matplotlib low level drawing primitives. I would therefore appreciate any good advice.
>> 
>> Best regards,
>> Jesper Baasch-Larsen
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Want excitement?
>> Manually upgrade your production database.
>> When you want reliability, choose Perforce
>> Perforce version control. Predictably reliable.
>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
> 
> 
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
From: Florin A. <fl...@an...> - 2014年09月18日 21:11:32
I've started with a data file consisting of one number per line, wide 
distribution of values. I've created a histogram out of it, showing the 
frequency of occurrence of values in about 200 bins. Even managed to do 
a log xscale.
#############################
import matplotlib.pyplot as plt
import numpy as np
with open('out-sorted.txt') as f:
	data = map(int, f)
f.close()
MIN = min(data)
MAX = max(data)
BINS = 200
n, bins, patches = plt.hist(data, bins = 10 ** 
np.linspace(np.log10(MIN), np.log10(MAX), BINS))
plt.gca().set_xscale("log")
plt.xlabel('latency (ms)')
plt.ylabel('number of occurences')
plt.show()
#############################
This is the result:
http://i.imgur.com/e4hb3Tw.png
The problem is, this is an aggregate of values over a large time 
interval. I would like to add another dimension to the histogram - 
timestamp, showing how this histogram varies in time. The frequency 
shall remain on the vertical axis; timestamp and the actual value shall 
be the 2 horizontal axes.
I could generate another data file, with each value prefixed with a 
timestamp in the format %Y-%m-%d-%H-00-00 (already truncated to the hour).
For all values sharing the same timestamp, I want to do a histogram, and 
then repeat the process on the timestamp axis. The value axis must be 
logarithmic, just like in the example shown above.
Any ideas? I'm new to Matplotlib and I'm not sure where to begin.
-- 
Florin Andrei
http://florin.myip.org/
From: Nils W. <ni...@go...> - 2014年09月18日 07:40:55
Hi all,
How can I add lines between points of a scatter plot in an interactive
manner ?
A small example would be appreciated.
Thanks in advance
 Nils
From: GoogleWind <goo...@16...> - 2014年09月18日 07:09:11
Dear all, I would like to create imshow map using ax.imshow(arr). However, I
got the image as Fig. 1. Is there any setting to get the image as Fig. 2
(i.e., without fill color for the cell).
<http://matplotlib.1069221.n5.nabble.com/file/n43975/1.png> 
Fig. 1
<http://matplotlib.1069221.n5.nabble.com/file/n43975/2.jpg> 
Fig. 2
Thanks in advance for your answer.
Jiacong Huang
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/A-imshow-map-without-fill-color-tp43975.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Ryan M. <rm...@gm...> - 2014年09月17日 19:49:56
Jesper,
For performance reasons, what _make_barbs() does is create a (almost
degenerate) polygon for each wind barb in the data set. The barbs are drawn
such that y is along the barb, and x is perpendicular to the barb; the barb
is then rotated as appropriate. The first point in the polygon is IIRC the
tip of the barb, so all that would be needed is to add a few points at the
beginning of the polygon to draw an arrow head shapee. Of course, all of
this is deep implementation detail, subject to change in the future, but
subclassing the Barbs class and overriding the _make_barbs() method should
be relatively ok. (I'd start with a copy of _make_barbs() and tweak as
necessary)
Ryan
On Wed, Sep 17, 2014 at 6:29 AM, Jesper Larsen <jes...@gm...>
wrote:
> Hi matplotlib users
>
> I am developing an application for showing weather forecasts using
> matplotlib. We use wind barbs for displaying wind forecasts:
>
>
> http://api.fcoo.dk/ifm-maps/greenland/?zoom=6&lat=62&lon=-45&layer=FCOO%20Standard&overlays=TTFFFFFFFFFFFFFFF
>
> This is fine for our "power users". We do however also have some users who
> are not used to wind barbs. I have elsewhere seen people put a small arrow
> head at the foot of the wind barbs to make it more clear which direction
> the wind blows toward.
>
> As far as I can see from the matplotlib quiver.py code this is not
> possible with matplotlib. But the _make_barbs method does not seem that
> complicated so I wondered if it is something that I can do myself. I have
> however never used the matplotlib low level drawing primitives. I would
> therefore appreciate any good advice.
>
> Best regards,
> Jesper Baasch-Larsen
>
>
>
>
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce
> Perforce version control. Predictably reliable.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Darren D. <dsd...@gm...> - 2014年09月17日 13:07:01
If you don't get an error message, and you don't get a window, it probably
means you matplotlib is defaulting to the Agg backend. The backend is set
by default in site-packages/matplotlib/mpl-data/matplotlibrc . What does
this report?:
import matplotlib
print(matplotlib.rcParams['backend'])
On my system, it reports 'Qt4Agg'. If your reports 'Agg', you can copy that
matplotlibrc file into your ~/.matplotlib directory, and edit the backend
based on whatever GUI toolkit you have installed or prefer.
Darren
On Tue, Sep 16, 2014 at 10:27 PM, 'Michiel de Hoon' via Anaconda - Public <
ana...@co...> wrote:
> The example works fine with matplotlib 1.4.0, python 3.4.0 (not from
> Anaconda) with Mac OS X Maverick.
>
> Best,
> -Michiel.
>
> --------------------------------------------
> On Wed, 9/17/14, Christophe Bal <pro...@gm...> wrote:
>
> Subject: [Matplotlib-users] Anaconda Mac or matplolib bug ?
> To: ana...@co..., mat...@li...
> Date: Wednesday, September 17, 2014, 2:19 AM
>
> Hello.
> I do not know the guilty people in this story.
> The following code works with Anaconda Python 3 on Lubuntu
> 14 but it does not with Anaconda Python 3 Mac OS Maverick.
> Why ?
> This message has been posted on both the list of
> Anaconda and the one of matplotlib.
> Christophe
> === Code ===
> # Source# * http://matplotlib.org/1.3.1/users/image_tutorial.html
> import matplotlib.pyplot as plt
> import matplotlib.image as mpimg
> impath = path2stinkbug_png"im =
> mpimg.imread(impath)
> implot = plt.imshow(im)
> plt.show()
>
>
> -----Inline Attachment Follows-----
>
>
> ------------------------------------------------------------------------------
> Want excitement?
> Manually upgrade your production database.
> When you want reliability, choose Perforce.
> Perforce version control. Predictably reliable.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> --
> Anaconda Community Support Group Brought to you by Continuum Analytics
> ---
> You received this message because you are subscribed to the Google Groups
> "Anaconda - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ana...@co....
> To post to this group, send email to ana...@co....
> Visit this group at
> http://groups.google.com/a/continuum.io/group/anaconda/.
>
From: Jesper L. <jes...@gm...> - 2014年09月17日 12:29:32
Hi matplotlib users
I am developing an application for showing weather forecasts using
matplotlib. We use wind barbs for displaying wind forecasts:
http://api.fcoo.dk/ifm-maps/greenland/?zoom=6&lat=62&lon=-45&layer=FCOO%20Standard&overlays=TTFFFFFFFFFFFFFFF
This is fine for our "power users". We do however also have some users who
are not used to wind barbs. I have elsewhere seen people put a small arrow
head at the foot of the wind barbs to make it more clear which direction
the wind blows toward.
As far as I can see from the matplotlib quiver.py code this is not possible
with matplotlib. But the _make_barbs method does not seem that complicated
so I wondered if it is something that I can do myself. I have however never
used the matplotlib low level drawing primitives. I would therefore
appreciate any good advice.
Best regards,
Jesper Baasch-Larsen
From: Michiel de H. <mjl...@ya...> - 2014年09月17日 02:28:02
The example works fine with matplotlib 1.4.0, python 3.4.0 (not from Anaconda) with Mac OS X Maverick.
Best,
-Michiel.
--------------------------------------------
On Wed, 9/17/14, Christophe Bal <pro...@gm...> wrote:
 Subject: [Matplotlib-users] Anaconda Mac or matplolib bug ?
 To: ana...@co..., mat...@li...
 Date: Wednesday, September 17, 2014, 2:19 AM
 
 Hello.
 I do not know the guilty people in this story.
 The following code works with Anaconda Python 3 on Lubuntu
 14 but it does not with Anaconda Python 3 Mac OS Maverick.
 Why ?
 This message has been posted on both the list of
 Anaconda and the one of matplotlib.
 Christophe
 === Code ===
 # Source#  * http://matplotlib.org/1.3.1/users/image_tutorial.html
 import matplotlib.pyplot as plt
 import matplotlib.image as mpimg
 impath = path2stinkbug_png"im =
 mpimg.imread(impath)
 implot = plt.imshow(im)
 plt.show()
 
 
 -----Inline Attachment Follows-----
 
 ------------------------------------------------------------------------------
 Want excitement?
 Manually upgrade your production database.
 When you want reliability, choose Perforce.
 Perforce version control. Predictably reliable.
 http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
 -----Inline Attachment Follows-----
 
 _______________________________________________
 Matplotlib-users mailing list
 Mat...@li...
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
From: Xiaobo Y. <xia...@gm...> - 2014年09月16日 21:20:04
many thanks - was struggling to find out where's the document!
On 16 September 2014 17:20, Scott Lasley <sl...@sp...> wrote:
>
> On Sep 16, 2014, at 11:31 AM, Xiaobo Yang <xia...@gm...> wrote:
>
> > Hi,
> >
> > My X axis represents dates. When I used get_xlim(), I got something like
> 735461.0 and 735490.5. What are these values? How can I convert to python
> date objects?
> >
> > Many thanks,
> > Tom
>
> See the matplotlib dates documentation at
>
> http://matplotlib.org/api/dates_api.html
>
>
From: Christophe B. <pro...@gm...> - 2014年09月16日 17:19:15
Hello.
I do not know the guilty people in this story. The following code works
with Anaconda Python 3 on Lubuntu 14 but it does not with Anaconda Python 3
Mac OS Maverick. Why ?
This message has been posted on both the list of Anaconda and the one of
matplotlib.
Christophe
=== Code ===
# Source
# * http://matplotlib.org/1.3.1/users/image_tutorial.html
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
impath = path2stinkbug_png"
im = mpimg.imread(impath)
implot = plt.imshow(im)
plt.show()
4 messages has been excluded from this view by a project administrator.

Showing results of 98

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