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


Showing results of 288

<< < 1 .. 3 4 5 6 7 .. 12 > >> (Page 5 of 12)
From: jenya56 <je...@ya...> - 2009年12月15日 17:26:13
I get this error:
"Matplotlib backend_wx and backened_wxagg require wxPython>=2.8"
I have Python 26 and the most current versions of Matplotlib, basemap, and
numpy. 
Anybody? Thanks
PS On educational note: what do you really need backend for? thanks
-- 
View this message in context: http://old.nabble.com/exception-error-for-matplotlib.use%28%22WXAgg%22%29-tp26798475p26798475.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Wellenreuther, G. <ger...@de...> - 2009年12月15日 17:15:56
Well, I am trying to create an overlay, *one* picture showing all 34
images. So I am only trying to create a single figure.
I just attached an example so you can get an idea (it was downsampled
for mailing, the original picture has ca. 5500 x 6500 pixels). In the
end, I just want to save the image to the disk, so I am using 'Agg' as
the backend - hope this also saves me some memory.
And about "old" images: I am always starting a completely new
python-process for each stitching (one at a time).
Cheers, Gerd
Perry Greenfield wrote:
> Are you clearing the figure after each image display? The figure retains 
> references to the image if you don't do a clf() and thus you will 
> eventually run out of memory, even if you delete the images (they don't 
> go away while matplotlib is using them).
> 
> Perry
> 
> On Dec 15, 2009, at 10:32 AM, Wellenreuther, Gerd wrote:
> 
>> Dear all,
>>
>> I am trying to write a script to be used with our microscope, stitching
>> images of various magnifications together to yield a big picture of a
>> sample. The preprocessing involves operations like rotating the picture
>> etc., and finally those pictures are being plotted using imshow.
>>
>> Unfortunately, I am running into memory problems, e.g.:
>>
>>> C:\Python26\lib\site-packages\PIL\Image.py:1264: DeprecationWarning: 
>>> integer argument expected, got float
>>> im = self.im.stretch(size, resample)
>>> Traceback (most recent call last):
>>> File "F:\Procs\Find_dendrites.py", line 1093, in <module>
>>> 
>>> file_type="PNG",do_stitching=do_stitching,do_dendrite_finding=do_dendrite_finding,down_sizing_factor=48,dpi=600) 
>>>
>>> File "F:\Procs\Find_dendrites.py", line 1052, in process_images
>>> scale,aspect_ratio,dpi,left,right,bottom,top)
>>> File "F:\Procs\Find_dendrites.py", line 145, in stitch_images
>>> pylab.draw()
>>> File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 352, 
>>> in draw
>>> get_current_fig_manager().canvas.draw()
>>> File 
>>> "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", 
>>> line 313, in draw
>>> self.renderer = self.get_renderer()
>>> File 
>>> "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", 
>>> line 324, in get_renderer
>>> self.renderer = RendererAgg(w, h, self.figure.dpi)
>>> File 
>>> "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", 
>>> line 59, in __init__
>>> self._renderer = _RendererAgg(int(width), int(height), dpi, 
>>> debug=False)
>>> RuntimeError: Could not allocate memory for image
>>
>> or
>>
>>> Traceback (most recent call last):
>>> File "F:\Procs\Find_dendrites.py", line 1093, in <module>
>>> 
>>> file_type="PNG",do_stitching=do_stitching,do_dendrite_finding=do_dendrite_finding,down_sizing_factor=48,dpi=75) 
>>>
>>> File "F:\Procs\Find_dendrites.py", line 1052, in process_images
>>> scale,aspect_ratio,dpi,left,right,bottom,top)
>>> File "F:\Procs\Find_dendrites.py", line 142, in stitch_images
>>> pylab.imshow(rotated_images[i],aspect='auto')
>>> File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 
>>> 2046, in imshow
>>> ret = ax.imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, 
>>> vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, 
>>> url, **kwargs)
>>> File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 6275, 
>>> in imshow
>>> im.set_data(X)
>>> File "C:\Python26\lib\site-packages\matplotlib\image.py", line 291, 
>>> in set_data
>>> self._A = pil_to_array(A)
>>> File "C:\Python26\lib\site-packages\matplotlib\image.py", line 856, 
>>> in pil_to_array
>>> x = toarray(im)
>>> File "C:\Python26\lib\site-packages\matplotlib\image.py", line 831, 
>>> in toarray
>>> x = np.fromstring(x_str,np.uint8)
>>> MemoryError
>>
>>
>> I already implemented some downscaling of the original images (ca. 3200
>> x 2400 pixels), to roughly match the figures dpi-setting. But this does
>> not seem to be the only issue. The script does work for dpi of 600 or
>> 150 for 11 individual images, yielding e.g. a 23 MB file with 600 dpi
>> and 36 Megapixels. But it fails for e.g. 35 images even for 75 dpi.
>>
>> I was trying to throw away any unneccessary data using del + triggering
>> the garbage collection, but this did not help beyond a certain point.
>> Maybe somebody could tell me what kind of limitations there are using
>> imshow to plot a lot of images together, and how to improve?
>>
>> Some more info: I am using Windows. Just by judging from the
>> task-manager, the preprocessing is not the problem. But *plotting* the
>> images using imshow seems to cause an increase of memory consumption of
>> the task of 32-33 MB *each* time. Somewhere around a total of 1.3 - 1.5
>> Gigs the process dies ...
>>
>> Thanks in advance,
>>
>> Gerd
>> -- 
>> Dr. Gerd Wellenreuther
>> beamline scientist P06 "Hard X-Ray Micro/Nano-Probe"
>> Petra III project
>> HASYLAB at DESY
>> Notkestr. 85
>> 22603 Hamburg
>>
>> Tel.: + 49 40 8998 5701
>>
>> ------------------------------------------------------------------------------ 
>>
>> Return on Information:
>> Google Enterprise Search pays you back
>> Get the facts.
>> http://p.sf.net/sfu/google-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Dr. Gerd Wellenreuther
beamline scientist P06 "Hard X-Ray Micro/Nano-Probe"
Petra III project
HASYLAB at DESY
Notkestr. 85
22603 Hamburg
Tel.: + 49 40 8998 5701
From: Jouni K. S. <jk...@ik...> - 2009年12月15日 15:44:05
stefan <wa...@we...> writes:
> I want to plot a line with very sharp features and many data points.
> [...] Is the '-' style doing some averaging before plotting or is it a
> rendering problem?
What version of matplotlib do you have? There have been some path
simplification bugs fixed recently. Try setting path.simplify to False
in the matplotlibrc file.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Wellenreuther, G. <ger...@de...> - 2009年12月15日 15:33:01
Dear all,
I am trying to write a script to be used with our microscope, stitching 
images of various magnifications together to yield a big picture of a 
sample. The preprocessing involves operations like rotating the picture 
etc., and finally those pictures are being plotted using imshow.
Unfortunately, I am running into memory problems, e.g.:
> C:\Python26\lib\site-packages\PIL\Image.py:1264: DeprecationWarning: integer argument expected, got float
> im = self.im.stretch(size, resample)
> Traceback (most recent call last):
> File "F:\Procs\Find_dendrites.py", line 1093, in <module>
> file_type="PNG",do_stitching=do_stitching,do_dendrite_finding=do_dendrite_finding,down_sizing_factor=48,dpi=600)
> File "F:\Procs\Find_dendrites.py", line 1052, in process_images
> scale,aspect_ratio,dpi,left,right,bottom,top)
> File "F:\Procs\Find_dendrites.py", line 145, in stitch_images
> pylab.draw()
> File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 352, in draw
> get_current_fig_manager().canvas.draw()
> File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", line 313, in draw
> self.renderer = self.get_renderer()
> File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", line 324, in get_renderer
> self.renderer = RendererAgg(w, h, self.figure.dpi)
> File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", line 59, in __init__
> self._renderer = _RendererAgg(int(width), int(height), dpi, debug=False)
> RuntimeError: Could not allocate memory for image
or
> Traceback (most recent call last):
> File "F:\Procs\Find_dendrites.py", line 1093, in <module>
> file_type="PNG",do_stitching=do_stitching,do_dendrite_finding=do_dendrite_finding,down_sizing_factor=48,dpi=75)
> File "F:\Procs\Find_dendrites.py", line 1052, in process_images
> scale,aspect_ratio,dpi,left,right,bottom,top)
> File "F:\Procs\Find_dendrites.py", line 142, in stitch_images
> pylab.imshow(rotated_images[i],aspect='auto')
> File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 2046, in imshow
> ret = ax.imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
> File "C:\Python26\lib\site-packages\matplotlib\axes.py", line 6275, in imshow
> im.set_data(X)
> File "C:\Python26\lib\site-packages\matplotlib\image.py", line 291, in set_data
> self._A = pil_to_array(A)
> File "C:\Python26\lib\site-packages\matplotlib\image.py", line 856, in pil_to_array
> x = toarray(im)
> File "C:\Python26\lib\site-packages\matplotlib\image.py", line 831, in toarray
> x = np.fromstring(x_str,np.uint8)
> MemoryError
I already implemented some downscaling of the original images (ca. 3200 
x 2400 pixels), to roughly match the figures dpi-setting. But this does 
not seem to be the only issue. The script does work for dpi of 600 or 
150 for 11 individual images, yielding e.g. a 23 MB file with 600 dpi 
and 36 Megapixels. But it fails for e.g. 35 images even for 75 dpi.
I was trying to throw away any unneccessary data using del + triggering 
the garbage collection, but this did not help beyond a certain point. 
Maybe somebody could tell me what kind of limitations there are using 
imshow to plot a lot of images together, and how to improve?
Some more info: I am using Windows. Just by judging from the 
task-manager, the preprocessing is not the problem. But *plotting* the 
images using imshow seems to cause an increase of memory consumption of 
the task of 32-33 MB *each* time. Somewhere around a total of 1.3 - 1.5 
Gigs the process dies ...
Thanks in advance,
Gerd
-- 
Dr. Gerd Wellenreuther
beamline scientist P06 "Hard X-Ray Micro/Nano-Probe"
Petra III project
HASYLAB at DESY
Notkestr. 85
22603 Hamburg
Tel.: + 49 40 8998 5701
From: Michael D. <md...@st...> - 2009年12月15日 15:17:08
Which version of matplotlib are you using? This is (I suspect) the 
result of a known bug in matplotlib that has been fixed since the latest 
release. In plots with large numbers of points, invisible points are 
automatically removed to increase performance and reduce file sizes, but 
this behavior was not fully correct.
You can either install the 0.99.x branch from SVN, or, as a workaround, 
set "path.simplify" to False in your matplotlibrc, at the expense of 
performance and file size.
Mike
stefan wrote:
> Hi,
>
> I want to plot a line with very sharp features and many data points. If I plot 
> the data with markers, the features can be seen perfectly. But if I choose the 
> line style just to be '-' (which is also default), the peaks are not shown 
> anymore. If I use something like '-o', the peaks are there, but the line does 
> not fully join the individual markers at the peak. Is the '-' style doing some 
> averaging before plotting or is it a rendering problem? And any suggestions 
> how to get rid of it?
>
> Thanks a lot!
>
> Stefan
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Antonino I. <tri...@gm...> - 2009年12月15日 14:12:44
Hi to all,
I'm doing a simple animation like this:
--
ion()
x = arange(0,2,0.01)
y = zeros_like(x)
y[45:55]=1
l, = plot(x,y)
D = 0.1
h = x[1]-x[0]
dt = 0.0001;
def nabla(v,h):
 na = zeros_like(v)
 na[1:-1] = (v[2:]-2*v[1:-1]+v[:-2])
 na[0],na[-1] = 0,0
 return na/(h**2)
for i in range(1000):
 y = y + D*nabla(y,h)*dt
 if i%10 == 0:
 l.set_ydata(y)
 draw()
--
however, changing the line
 y = y + D*nabla(y,h)*dt with
in
 y += D*nabla(y,h)*dt
the plot is not updated anymore. I have to replace l.set_ydata(y) with
y.recache() to make the the animation work again.
I think this is a bug since the line should be updated even using the
+= operator.
Regards,
Antonio
From: stefan <wa...@we...> - 2009年12月15日 12:38:47
Hi,
I want to plot a line with very sharp features and many data points. If I plot 
the data with markers, the features can be seen perfectly. But if I choose the 
line style just to be '-' (which is also default), the peaks are not shown 
anymore. If I use something like '-o', the peaks are there, but the line does 
not fully join the individual markers at the peak. Is the '-' style doing some 
averaging before plotting or is it a rendering problem? And any suggestions 
how to get rid of it?
Thanks a lot!
Stefan
From: Jae-Joon L. <lee...@gm...> - 2009年12月15日 03:44:05
Yes, axes location in mpl, by design, is specified in normalized
figure coordinate.
And, for the colorbar axes to match the height (or width) of the
parent axes always , you need to manually update the location of the
colorbar axes.
There are a few ways to do this. You may use event callbacks, use
custom axes class, or use Axes._axes_locator attribute (which is a
callable object that returns the new axes postion).
The axes_grid toolkit has some helper functions for this, and you may
take a look if interested.
http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_divider.html
-JJ
On Mon, Dec 14, 2009 at 2:18 PM, Thomas Robitaille
<tho...@gm...> wrote:
> Hi,
>
> I would like to plot a colorbar which automatically gets resized when
> I change the view limits and the aspect ratio of the main axes. So for
> example:
>
> import matplotlib.pyplot as mpl
> import numpy as np
>
> fig = mpl.figure()
> ax = fig.add_axes([0.1,0.1,0.7,0.8])
> cax = fig.add_axes([0.81,0.1,0.02,0.8])
>
> image = ax.imshow(np.random.random((100,100)))
>
> fig.colorbar(image, cax=cax)
>
> Is fine, but then if I interactively select a sub-region to zoom in
> with a different aspect ratio, which I can also emulate by doing
>
> ax.set_ylim(40.,60.)
>
> The colorbar is then too high. If I then do
>
> ax.set_xlim(50.,55.)
>
> The height is fine but the position would need changing.
>
> Is there an easy way to get around this issue and have the colorbar
> always at a fixed distance from the main axes, and also have it
> resize? Or is the only way to write this all explicitly using event
> callbacks?
>
> Thanks for any help,
>
> Thomas
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric F. <ef...@ha...> - 2009年12月15日 02:37:07
nbv4 wrote:
> The histogram example in the matpolotlib gallery is just what I want, except
> instead of "probility" shown on the Y-axis, I want the number of items that
> fall into each bin to be plotted. How do I do this? Here is my code:
> 
> import numpy as np
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> 
> x = self.data ## a list, such as [12.43, 34.24, 35.56, 465.3547, ]
> ax.hist(x, 60, normed=1, facecolor='green', alpha=0.75)
Leave out the "normed" kwarg, or set it to False (the default).
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hist
> 
> ax.set_xlabel('Totals')
> ax.set_ylabel('Number of Users'))
> ax.set_xlim(0, 2000)
> ax.set_ylim(0, 0.003)
> ax.grid(True)
From: Ryan M. <rm...@gm...> - 2009年12月15日 02:05:50
On Mon, Dec 14, 2009 at 7:22 PM, nbv4 <cp3...@oh...> wrote:
>
> The histogram example in the matpolotlib gallery is just what I want, except
> instead of "probility" shown on the Y-axis, I want the number of items that
> fall into each bin to be plotted. How do I do this? Here is my code:
>
>    import numpy as np
>    import matplotlib
>    matplotlib.use('Agg')
>    import matplotlib.pyplot as plt
>
>    fig = plt.figure()
>    ax = fig.add_subplot(111)
>
>    x = self.data ## a list, such as [12.43, 34.24, 35.56, 465.3547, ]
>    ax.hist(x, 60, normed=1, facecolor='green', alpha=0.75)
>From the docstring for ax.hist:
 *normed*:
 If *True*, the first element of the return tuple will
 be the counts normalized to form a probability density, i.e.,
 ``n/(len(x)*dbin)``. In a probability density, the integral of
 the histogram should be 1; you can verify that with a
 trapezoidal integration of the probability density function::
 pdf, bins, patches = ax.hist(...)
 print np.sum(pdf * np.diff(bins))
So instead, pass normed=False (instead of normed=1) to the call to ax.hist.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: nbv4 <cp3...@oh...> - 2009年12月15日 01:22:48
The histogram example in the matpolotlib gallery is just what I want, except
instead of "probility" shown on the Y-axis, I want the number of items that
fall into each bin to be plotted. How do I do this? Here is my code:
 import numpy as np
 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
 fig = plt.figure()
 ax = fig.add_subplot(111)
 x = self.data ## a list, such as [12.43, 34.24, 35.56, 465.3547, ]
 ax.hist(x, 60, normed=1, facecolor='green', alpha=0.75)
 ax.set_xlabel('Totals')
 ax.set_ylabel('Number of Users'))
 ax.set_xlim(0, 2000)
 ax.set_ylim(0, 0.003)
 ax.grid(True)
-- 
View this message in context: http://old.nabble.com/Histogram-without-probability-tp26781968p26781968.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年12月14日 22:01:56
On Mon, Dec 14, 2009 at 12:38 PM, jenya56 <je...@ya...> wrote:
>
> I have the following in my PyScripter:
>
> import matplotlib
> matplotlib.interactive(True)
> from matplotlib.pylab import *
> import pylab
>
>
> if __name__ == '__main__':
>  plot([1,2,3])
>  pylab.show()
> #__main__
>
>
> For the first run it works just fine and plots what expected. However, on
> the second run it just gives gray window without plot...Any suggestions?
> Thanks
Have you seen this:
http://code.google.com/p/pyscripter/wiki/FAQ#How_do_I_use_Matplotlib_with_PyScripter_?
JDH
From: Jouni K. S. <jk...@ik...> - 2009年12月14日 19:27:47
Jose Gomez-Dans <jgo...@gm...> writes:
> I find this problem when generating a PDF and viewing it in Linux,but the
> on-screen version seems to work fine. 
While the PDF format has advanced support for different color spaces and
rendering intents, the current PDF backend just uses DeviceRGB and
whatever the default rendering intent is. I wonder if some kind of
different color space or such setting would help - but this is a subject
that I know almost nothing about, and the PDF support is so complex that
I don't even know what the next reasonable step would be above just
using DeviceRGB.
Does the bluemarble image come with a specification or documentation
that mentions a color space, or what the pixel values are supposed to
mean, or how they are recommended to be rendered?
> Another thing you can do is to modify the bluemarble that
> comes with matplotlib using the gimp, as it is just an image file you can
> edit easily. Starts looking like data cooking, tho' ;-)
The fact is that different devices (displays, printers, projectors) have
different gamuts, and unless there is a specified color space, a set of
pixel values has no "right" mapping to the colors of the gamut (and even
if the space is known, mapping out-of-gamut colors can be done in
several ways). So I wouldn't call it "data cooking" if you are just
trying to get a reasonable contrast in your visualization of some data
that consists of values in some arbitrary space, although of course it
will not be any kind of true-color image either.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Thomas R. <tho...@gm...> - 2009年12月14日 19:18:17
Hi,
I would like to plot a colorbar which automatically gets resized when 
I change the view limits and the aspect ratio of the main axes. So for 
example:
import matplotlib.pyplot as mpl
import numpy as np
fig = mpl.figure()
ax = fig.add_axes([0.1,0.1,0.7,0.8])
cax = fig.add_axes([0.81,0.1,0.02,0.8])
image = ax.imshow(np.random.random((100,100)))
fig.colorbar(image, cax=cax)
Is fine, but then if I interactively select a sub-region to zoom in 
with a different aspect ratio, which I can also emulate by doing
ax.set_ylim(40.,60.)
The colorbar is then too high. If I then do
ax.set_xlim(50.,55.)
The height is fine but the position would need changing.
Is there an easy way to get around this issue and have the colorbar 
always at a fixed distance from the main axes, and also have it 
resize? Or is the only way to write this all explicitly using event 
callbacks?
Thanks for any help,
Thomas
From: John H. <jd...@gm...> - 2009年12月14日 18:55:14
We are looking to hire a quantitative researcher to help research and
develop trading ideas, and to develop and support infrastructure to
put these trading strategies into production. We are looking for
someone who is bright and curious with a quantitative background and a
strong interest in writing good code and building systems that work.
Experience with probability, statistics and time series is required,
and experience working with real world data is a definite plus. We do
not require a financial background, but are looking for someone with
an enthusiasm to dive into this industry and learn a lot. We do most
of our data modeling and production software in python and R. We have
a lot of ideas to test and hopefully put into production, and you'll
be working with a fast paced and friendly small team of traders,
programmers and quantitative researchers.
Applying:
 Please submit a resume and cover letter to qs...@tr.... In
 your cover letter, please address how your background, experience
 and skills will fit into the position described above. We are
 looking for a full-time, on-site candidate only.
About Us:
 TradeLink Holdings LLC is a diversified alternative investment,
 trading and software firm. Headquartered in Chicago, TradeLink
 Holdings LLC includes a number of closely related entities. Since
 its organization in 1979, TradeLink has been actively engaged in the
 securities, futures, options, and commodities trading
 industries. Engaged in the option arbitrage business since 1983,
 TradeLink has a floor trading and/or electronic trading interface in
 commodity options, financial futures and options, and currency
 futures and options at all major U.S. exchanges. TradeLink is
 involved in various market-making programs in many different
 exchanges around the world, including over-the-counter derivatives
 markets. http://www.tradelinkllc.com
From: jenya56 <je...@ya...> - 2009年12月14日 18:38:43
I have the following in my PyScripter:
import matplotlib
matplotlib.interactive(True)
from matplotlib.pylab import *
import pylab
if __name__ == '__main__':
 plot([1,2,3])
 pylab.show()
#__main__
For the first run it works just fine and plots what expected. However, on
the second run it just gives gray window without plot...Any suggestions?
Thanks
-- 
View this message in context: http://old.nabble.com/first-run-works-fine-but-on-the-second-not-tp26779948p26779948.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jose Gomez-D. <jgo...@gm...> - 2009年12月14日 18:31:19
Hi!
2009年12月14日 jenya56 <je...@ya...>
>
> 1.) How to control the size of each circle on the scatter plot
>
Use the "s" option to scatter (units are points**2)
> 2.) How to add the coast line with lambert projection?
>
You want to use the basemap extension. An example can be found in this blog:
<
http://stevendkay.wordpress.com/2009/10/12/scatter-plots-with-basemap-and-matplotlib/
>
Cheers,
Jose
From: jenya56 <je...@ya...> - 2009年12月14日 17:57:10
The update:
I was able to produce the plot with:
fig = P.figure()
ax = fig.add_subplot(1,1,1)
cmap = P.matplotlib.cm.jet
norm = P.matplotlib.colors.Normalsize(vmin=0,vmax=1)
sc = ax.scatter(ave_lon,ave_lat,c=v,cmap=cmap,norm=norm)
savefig('sg.png')
However, I have a few questions:
1.) How to control the size of each circle on the scatter plot
2.) How to add the coast line with lambert projection?
THANKS
jenya56 wrote:
> 
> Dear all, I was wondering if there is equivalent in python of this
> function:
> PLOTCLR(X,Y,V) plots the values specified in V as a color coded scatter
> plot at the locations specified in the vectors X and Y. The current
> colormap of the figure is used for the color code. Any suggestions?
> Thanks.
> 
-- 
View this message in context: http://old.nabble.com/advaced-scatter-plot-tp26779933p26779939.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年12月14日 17:37:05
On Mon, Dec 14, 2009 at 11:31 AM, jenya56 <je...@ya...> wrote:
>
> Dear all, I was wondering if there is equivalent in python of this function:
> PLOTCLR(X,Y,V) plots the values specified in V as a color coded scatter plot
> at the locations specified in the vectors X and Y. The current colormap of
> the figure is used for the color code. Any suggestions? Thanks.
"scatter" should do it
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter
http://matplotlib.sourceforge.net/search.html?q=codex+scatter
From: jenya56 <je...@ya...> - 2009年12月14日 17:31:21
Dear all, I was wondering if there is equivalent in python of this function:
PLOTCLR(X,Y,V) plots the values specified in V as a color coded scatter plot
at the locations specified in the vectors X and Y. The current colormap of
the figure is used for the color code. Any suggestions? Thanks.
-- 
View this message in context: http://old.nabble.com/advaced-scatter-plot-tp26779933p26779933.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年12月14日 17:27:26
On Mon, Dec 14, 2009 at 10:22 AM, Susanne Pfeifer <ti...@ti...> wrote:
> Hello,
>
> I am relatively new to matplotlib and I was wondering whether there is
> an easy possibility to generate a histogram whose height is normalized
> to one (rather than the total area under the curve which is the case if
> I use normed=1).
Use np.histogram to generate the counts, divide these by the sum of
the counts, and use pyplot.bar to plot the bar heights. Something
like
In [44]: x = np.random.randn(10000)
In [45]: n, bins = np.histogram(x, bins=20)
In [46]: left = bins[:-1]
In [47]: width = bins[1] - bins[0]
In [48]: pct = n/float(n.sum())
In [49]: plt.bar(left, pct, width=width)
JDH
From: Susanne P. <ti...@ti...> - 2009年12月14日 16:38:38
Hello,
I am relatively new to matplotlib and I was wondering whether there is
an easy possibility to generate a histogram whose height is normalized
to one (rather than the total area under the curve which is the case if
I use normed=1).
Thank you for your help,
Tiffy
From: Trevor I. <tre...@gm...> - 2009年12月14日 15:35:15
Thanks,
This almost does what I want. The labels are now changed to log notation,
but the tick locations have remained the same. I want the spacing between
each logarithmic decade to be equal. I just did an svn up and rebuild so I
am working with bleeding edge matplotlib. Do I need to manually set the
locations of the ticks? I'll play around a bit more with w_yaxis, I wasn't
aware of this.
Danke vel,
Trevor
2009年12月13日 Reinier Heeres <re...@he...>
> Hi,
>
> You'll have to use ax.w_yaxis.set_yscale('log'), which should work fine.
>
> Hope this helps,
> Reinier
>
> On Tue, Dec 8, 2009 at 5:11 PM, Trevor Irons <tre...@gm...>
> wrote:
> > Hi:
> >
> > I'm trying to get a semilog 3D plot. I want to plot several 2D time
> series
> > lines, with the third axis being on a log scale. I am trying to set an
> axis
> > to log using ax.set_yscale('log'), but am getting errors. Is this
> possible?
> >
> > I keep getting numpy errors when I try:
> > raise MaskError, 'Cannot convert masked element to a Python int.'
> > numpy.ma.core.MaskError: Cannot convert masked element to a Python int.
> >
> > My attempt:
> >
> > from mpl_toolkits.mplot3d import Axes3D
> > import matplotlib.pyplot as plt
> > import numpy as np
> >
> > fig = plt.figure()
> > #ax = fig.gca()
> > ax = Axes3D(fig)
> >
> > colors = ('r', 'g', 'b', 'k')
> > zd = (0., 1., 2., 3.)
> > T2 = (0.9, .8, .7, .6)
> > ic = 1
> >
> > for ic in xrange(len(colors)):
> > x = np.arange(0.05,1,.005)
> > z = np.exp(-x/T2[ic]) + np.random.normal(0, .05, len(x))
> > y = np.exp(zd[ic])*np.ones(len(x))
> > ax.plot(x,y,z)
> >
> > # Error if uncommented
> > #ax.set_yscale('log')
> > plt.show()
> >
> > Thanks for any insight.
>
> --
> Reinier Heeres
> Tel: +31 6 10852639
>
From: Jose Gomez-D. <jgo...@gm...> - 2009年12月14日 13:54:24
Hi,
2009年12月14日 Dr. Phillip M. Feldman <pfe...@ve...>
> When I generate a map with a background generated via Basemap.bluemarble(),
> the background is extremely dark. Is there any way to get a
> lighter/brighter version? (I've looked at all of the available parameters,
> but none of them seems to allow for adjustment of the luminance).
>
I find this problem when generating a PDF and viewing it in Linux,but the
on-screen version seems to work fine. One reason for your darkness might be
the actual bluemarble scene. There is one for every month <
http://earthobservatory.nasa.gov/Features/BlueMarble/>, so you can have a
look at the different month and pick u which is better for your
area/application. Another thing you can do is to modify the bluemarble that
comes with matplotlib using the gimp, as it is just an image file you can
edit easily. Starts looking like data cooking, tho' ;-)
J
From: Dr. P. M. F. <pfe...@ve...> - 2009年12月14日 04:17:39
When I generate a map with a background generated via Basemap.bluemarble(),
the background is extremely dark. Is there any way to get a
lighter/brighter version? (I've looked at all of the available parameters,
but none of them seems to allow for adjustment of the luminance).
-- 
View this message in context: http://old.nabble.com/bluemarble-is-too-dark-tp26772824p26772824.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
22 messages has been excluded from this view by a project administrator.

Showing results of 288

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