Re: [Matplotlib-users] problem with usetex & \color

2009-05-14 Thread Matthias Michler
Hi Jae-Joon,

thank you very much for taking the time and for your suggestions. Indeed the 
different distillers yield different output as you can see in the attached 
pics. Does this mean that this behaviour is due to tex / the installed 
distiller or are different distillers differently handled in matplotlib?
Especially the different used papersize A4/Letter vs. small region around text 
seems to be remarkable.

best regards
Matthias

On Wednesday 13 May 2009 20:48:09 Jae-Joon Lee wrote:
> Hmm, I have no idea what is wrong and I'm afraid that there is not
> much I can do.
> ps backend undergoes several steps (tex - dvi - ps - [distiller]) to
> produce the final output, and it is hard to track down the problem
> without actually reproducing one.
>
> Just in case, can you change your distiller option and see if it makes
> any difference?
>
> rc("ps", usedistiller="ghostscript") # this would be the default
>
> or
>
> rc("ps", usedistiller="xpdf")
>
> -JJ
>
>
>
> On Wed, May 13, 2009 at 3:22 AM, Matthias Michler
>
>  wrote:
> > Hi Jae-Joon,
> >
> > I updated to svn-revision 7099 and the problem (hidden part of b) still
> > exists. Do you have any idea what I'm doing wrong?
> >
> > Thanks in advance for any hints.
> >
> > best regards Matthias
> >
> > On Tuesday 12 May 2009 20:46:06 Jae-Joon Lee wrote:
> >> On Tue, May 12, 2009 at 5:04 AM, Matthias Michler
> >>
> >>  wrote:
> >> > Hello list,
> >> >
> >> > I'm not sure that following problem also occurs for Sebastian, but if
> >> > I use PS-backend in the below script I get the attached output, where
> >> > the upper part of the b is somehow hidden (matplotlib-version
> >> > 0.98.6svn). Is this a problem of matplotlib or did I miss something in
> >> > the tex-handling?
> >>
> >> Unfortunately, I don't see such problem, although the problem seems to
> >> be due to a wrong bounding box.
> >>
> >> Are you using the most recent svn? There has been some recent changes
> >> in ps backend. Before the changes (r7068, r7074), the ps backend tried
> >> to adjust the bounding box of the output ps file. However, as far as I
> >> can see, this often gave a wrong bounding box (and I guess your
> >> problem might be related with this issue). The above mentioned changes
> >> somehow bypass that bbox adjustment. The resulting bounding box should
> >> have the size of the figure if saved in eps, or size of the paper
> >> ("letter" or "a4", I guess) if saved in ps.
> >>
> >> regards,
> >>
> >> -JJ
> >>
> >> > best regards Matthias
> >> >
> >> >> 
> >> >
> >> > from matplotlib import use, rc
> >> > use('PS')
> >> > from pylab import figure, savefig
> >> >
> >> > rc('text', usetex=True)
> >> > rc('text.latex', preamble="\usepackage{color}")
> >> >
> >> > f = figure()
> >> > f.text(0.5, 0.5, r"{\color[rgb]{0,1,0} a } b {\color{blue} $\nu, \mu,
> >> > \tau$}")
> >> >
> >> > savefig('test_tex_color.ps')
> >> >
> >> >> 
> >> >
> >> > On Monday 11 May 2009 20:36:58 Jae-Joon Lee wrote:
> >> >> > The resulting graph is not colored -- but in the directory
> >> >> > ~/.matplotlib/tex.cache/ the text is green, both in the dvi and the
> >> >> > png file!
> >> >> >
> >> >> > It therefore seems to me that this is not completely hopeless but I
> >> >> > cannot figure out how to proceed.
> >> >>
> >> >> As far as I know, in matplotlib, all the tex png output is treated as
> >> >> grey  internally (the only exception I know of is ps backend, e.g.,
> >> >> your example will show you a correct color if you save it as ps). I
> >> >> guess this may have been a design decision.
> >> >> As far as I can see, MPL currently does not support texts with
> >> >> varying font properties (size, color, font).
> >> >> One possible workaround for this could be using the latex typesetting
> >> >> as you tried. However, supporting this within the current text
> >> >> framework of matplotlib would be difficult and may not be a good
> >> >> idea.
> >> >>
> >> >>
> >> >> However, I guess there are a few workarounds you may consider to use
> >> >> (but unfortunately I think none of them are easy to work with). So,
> >> >> if you describe where you intend to use multi-color text, I'll try to
> >> >> give some example appropriate for your situation. Multi-color text in
> >> >> figure title or simple annotation would be relatively simple.
> >> >> Multi-color text in legend label seems to be more difficult, but
> >> >> should be doable.
> >> >>
> >> >> -JJ
> >
> > -
> >- The NEW KODAK i700 Series Scanners deliver under ANY circumstances!
> > Your production scanning environment may not be a perfect world - but
> > thanks to Kodak, there's a perfect scanner to get the job done! With the
> > NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with
> > all image processing features enabled. http://p.sf.net/sfu/kodak-com
> > 

Re: [Matplotlib-users] contour overlapping

2009-05-14 Thread Bala subramanian
Thank you Matthias, Sebastin and Armin!!!

My matrices are square matrices and not rectangular one.  I tried the way of
creating a new matrix from existing ones as suggested by matthias and it
worked great. I will try the masked array method too.

Thank you all once again,
Bala

On Wed, May 13, 2009 at 6:45 PM, Matthias Michler
wrote:

> Hi Bala,
>
> I'm not sure I understand, what you want, but maybe the following goes
> towards
> your direction
>
> # initialise two matrices with data
> matrix1 = ones((4,4))
> matrix2 = 2*ones((4,4))
> # and one empty matrix
> matrix3 = zeros((4, 4))
>
> for i in xrange(len(matrix3[:, 0])): # all rows
>for j in xrange(len(matrix3[0, :])):# all columns
>if i > j: # if below diagonal take matrix1
>matrix3[i, j] = matrix1[i, j]
>elif i < j: # if above diagonal take matrix 2
>matrix3[i, j] = matrix2[i, j]
>
> In [40]: print matrix3
> Out[40]:
> array([[ 0.,  2.,  2.,  2.],
>   [ 1.,  0.,  2.,  2.],
>   [ 1.,  1.,  0.,  2.],
>   [ 1.,  1.,  1.,  0.]])
>
> With that matrix3 holds elements of matrix2 in the upper part and elements
> of
> matrix1 below the diagonal. This one could be plotted with contour or
> contourf.
>
> Is that what you want?
>
> best regards Matthias
>
> On Wednesday 13 May 2009 18:12:53 Bala subramanian wrote:
> > Armin,
> > I tried this but what happens is it is not overlapping, actually when i
> > call contour function for the second time with matrix2, the plot is
> updated
> > with contour of matrix 2.
> >
> > contour(matrix1)
> > contour(matrix2).
> >
> > What i finally get is the contour of matrix 2 as the final plot. What i
> am
> > trying to do is that, i shd have one plot, with upper left panel for
> > matrix1 and lower right panel for matrix2 with their separation along the
> > diagonal. I have attached an example picture like which i am trying to
> > make.
> >
> > Bala
> >
> > On Wed, May 13, 2009 at 5:33 PM, Armin Moser
> >
> > wrote:
> > > Bala subramanian schrieb:
> > > > hai Armin,
> > > >
> > > > I looked through the examples. I could not find any example of
> > >
> > > overlapping
> > >
> > > > two differnet countours on the same plot.
> > >
> > > I think the first example filled contours does exactly that. You want
> to
> > > show two contours over each other in the same plot.
> > > You just have to substitute the Z in cset_1 with matrix_1 and in cset_2
> > > with matrix_2. Of course it will be helpful to use different colormaps.
> > > E.g. a grey one for the underlying contour and a colored for the top
> one.
> > >
> > > x = arange(5)
> > > y = arange(5)
> > > x,y = meshgrid(x,y)
> > > Z = x**2+y**2
> > > #contourf(Z,cmap=cm.binary) # filled contours gray
> > > contour(Z) # not filled contours colored
> > > error = rand(x.shape[0],x.shape[1]) # to generate a new Z
> > > Z = (x+error)**2+(y+error)**2
> > > contour(Z) # colored not filled contours
> > >
> > > Armin
>
>
>
>
> --
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contour overlapping

2009-05-14 Thread Sebastian Busch
Armin Moser wrote:
> Sebastian Busch wrote:
>> ...
>> array([list(a[i,:i])+list(b[i,i:]) for i in range(a.shape[0])])
> It seems that I did not understand what you tried to reach.
> ...

Sorry. I wanted to do the same as Matthias -- taking his example:


=
from scipy import ones, array

matrix1 = ones((4,4))
matrix2 = 2*ones((4,4))
matrix3 = array([list(matrix1[i,:i])+list(matrix2[i,i:])\
for i in range(matrix1.shape[0])])
=

yields

matrix3
array([[ 2.,  2.,  2.,  2.],
   [ 1.,  2.,  2.,  2.],
   [ 1.,  1.,  2.,  2.],
   [ 1.,  1.,  1.,  2.]])


it's quite the same, you just have to type less :)


best,
sebastian.



signature.asc
Description: OpenPGP digital signature
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contour overlapping

2009-05-14 Thread Armin Moser
Sebastian Busch schrieb:
> Armin Moser wrote:
>> Sebastian Busch wrote:
>>> ...
>>> array([list(a[i,:i])+list(b[i,i:]) for i in range(a.shape[0])])
>> It seems that I did not understand what you tried to reach.
>> ...
> 
> Sorry. I wanted to do the same as Matthias -- taking his example:
I meant I did not understand in the first what Bala tried to reach. I
have answered to the wrong mail and quoted badly. Sorry

Armin


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Annotations with pan / zoom

2009-05-14 Thread Ben Coppin
Hi,

I've added annotations to a graph I am producing using matplotlib. The
annotations work fine, but when you zoom and pan, the annotations move off
the edge of the chart and are still visible while they're in the main TK
window. Does anyone know of a way to make the annotations disappear when
they move off the edge of the chart?

Thanks,

Ben
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Canvas in wx.ScrolledPanel

2009-05-14 Thread Gregor Thalhammer
Thomas Coudrat schrieb:
> Hello list,
>
> I am new here an i need help on something : I am using Matplotlib in 
> the wxPython GUI, and i am trying to draw a BIG canvas, in a SMALL 
> window, which would be scrollable.
> My implementation works if i use simple text too long for the size of 
> the window (see example file)
> But the problem with the canvas is that is resizes to fit the window, 
> and i would like to be able to draw HUGE figures, which would be 
> scrollable.
> (in order print the figure, just uncomment the 3 lines, and comment 
> the wx.StaticText line)
>
> I hope i made my problem clear enough so that someone can help me out.
>
> Thanks in advance!
It seems to me your implementation already provides what you want. But 
if you want to show huge figures, you have to make them huge:

fig = matplotlib.figure.Figure(figsize=(10,10))

You could also try to inhibit scaling of the figure, box.Add(canvas, 0, 
wx.ALL), then the matplotlib figure inside the scrolled panel will 
always have the same size.

Gregor




--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Sublots in several figures

2009-05-14 Thread Stefanie Lück
Hi!

I have 3 line charts which I would like to add one by one in a Figure() 
(back-to-back) to a wxPython Scrollpanel . I tried this code but all 3 charts 
are allways put together in each figure. How can I add them seperate in one 
figure?
Thanks in advance! The data files are attached.
Stefanie

# -*- coding: latin1 -*-
import sys

import wx
import wx.lib.scrolledpanel as SP

from matplotlib.backends.backend_wx import FigureCanvasWx
from matplotlib.figure import Figure
import matplotlib.numerix as numpy
from pylab import array, arange, sin, cos, exp, pi, randn, normpdf, meshgrid, \
convolve

class MyFrame(wx.Frame):

def __init__(self):
wx.Frame.__init__(self, None, -1, "My Frame", size=(300, 300))
self.panel = SP.ScrolledPanel(self, -1)
self.panel.SetBackgroundColour('WHITE')
   
vbox = wx.BoxSizer(wx.VERTICAL)
sizer = wx.GridBagSizer(hgap=10, vgap=5)

f_a = open('all_name_list.txt', 'r')
#f_e = open('eff_name_list.txt', 'r')

all = f_a.readlines()
#eff = f_e.readlines()
n = 1
for i in all:
self.fig = Figure()
self.canvas = FigureCanvasWx(self.panel, -1, self.fig)
sizer.Add(self.canvas, pos=(n, 1), 
flag=wx.EXPAND|wx.GROW|wx.ALIGN_CENTER)
n = n + 1
self.plot_data(self.fig)

vbox.Add(sizer, 0, wx.ALL|wx.ALIGN_CENTER, 10)
 
self.panel.SetSizer(vbox)
self.panel.SetAutoLayout(1)
self.panel.SetupScrolling()
   
self.ShowFullScreen(True, style = wx.FULLSCREEN_NOMENUBAR)

def plot_data(self, figure):
f_a = open('all_name_list.txt', 'r')
#f_e = open('eff_name_list.txt', 'r')

all = f_a.readlines()
#eff = f_e.readlines()

for a in all:
a = a.replace('\n', '')
f = open(a + '_eff_counts.txt', 'r')
data = f.readlines()

listex = []
listey = []
for line in data:
line = line.strip() 
x = line.split(" ") 
listex.append(int(x[0]))
listey.append(int(x[1]))

b = figure.add_subplot(111)
b.plot(listex,listey) 
#b = figure.add_subplot(111)
#b.plot([0,2,4,122], [4, 8, 10, 140]) 
b.set_xbound(0, 2100)
b.set_ybound(-5, 50)
b.set_title(a)
  

if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 0
15 0
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
24 2
25 2
26 2
27 2
28 2
29 2
30 2
31 2
32 2
33 2
34 2
35 2
36 2
37 2
38 2
39 2
40 2
41 2
42 2
43 2
44 0
45 0
46 0
47 0
48 0
49 0
50 0
51 0
52 0
53 0
54 0
55 0
56 0
57 0
58 0
59 0
60 0
61 0
62 0
63 0
64 0
65 0
66 0
67 0
68 0
69 0
70 0
71 0
72 0
73 0
74 0
75 0
76 0
77 0
78 0
79 0
80 0
81 0
82 0
83 0
84 0
85 0
86 0
87 0
88 0
89 0
90 0
91 0
92 0
93 0
94 0
95 0
96 0
97 0
98 0
99 0
100 0
101 0
102 0
103 0
104 0
105 0
106 0
107 0
108 0
109 0
110 0
111 0
112 0
113 0
114 0
115 0
116 0
117 0
118 0
119 0
120 0
121 0
122 0
123 0
124 0
125 0
126 0
127 0
128 0
129 0
130 0
131 0
132 0
133 0
134 0
135 0
136 0
137 0
138 0
139 0
140 0
141 0
142 0
143 0
144 0
145 0
146 0
147 0
148 0
149 0
150 2
151 4
152 6
153 8
154 10
155 12
156 14
157 16
158 16
159 16
160 16
161 16
162 16
163 16
164 16
165 16
166 16
167 16
168 16
169 16
170 14
171 12
172 10
173 8
174 6
175 4
176 2
177 0
178 0
179 0
180 0
181 0
182 0
183 0
184 0
185 0
186 0
187 0
188 0
189 0
190 0
191 0
192 0
193 0
194 0
195 0
196 0
197 0
198 0
199 0
200 0
201 0
202 0
203 0
204 0
205 0
206 0
207 0
208 0
209 0
210 0
211 0
212 0
213 0
214 0
215 0
216 0
217 0
218 0
219 0
220 0
221 0
222 2
223 4
224 6
225 8
226 10
227 12
228 14
229 16
230 18
231 20
232 22
233 22
234 22
235 22
236 22
237 22
238 22
239 22
240 22
241 22
242 20
243 18
244 16
245 14
246 12
247 10
248 8
249 6
250 4
251 2
252 0
253 0
254 0
255 0
256 0
257 0
258 0
259 0
260 0
261 0
262 0
263 0
264 0
265 0
266 0
267 0
268 0
269 0
270 0
271 0
272 0
273 0
274 0
275 0
276 0
277 0
278 0
279 0
280 0
281 0
282 0
283 0
284 0
285 0
286 0
287 0
288 0
289 0
290 0
291 0
292 0
293 0
294 0
295 0
296 0
297 0
298 0
299 0
300 0
301 0
302 0
303 0
304 0
305 0
306 0
307 0
308 0
309 0
310 0
311 0
312 0
313 0
314 0
315 0
316 0
317 0
318 0
319 0
320 0
321 0
322 0
323 0
324 0
325 0
326 0
327 0
328 0
329 0
330 0
331 0
332 0
333 0
334 0
335 0
336 0
337 0
338 0
339 0
340 0
341 0
342 0
343 0
344 0
345 0
346 0
347 0
348 0
349 0
350 0
351 0
352 0
353 0
354 0
355 0
356 0
357 0
358 0
359 0
360 0
361 0
362 0
363 0
364 0
365 0
366 0
367 0
368 2
369 4
370 6
371 8
372 8
373 8
374 8
375 8
376 8
377 8
378 8
379 8
380 8
381 8
382 8
383 8
384 8
385 8
386 8
387 8
388 6
389 4
390 2
391 0
392 0
393 0
394 0
395 0
396 0
397 0
398 0
399 0
400 0
401 0
402 0
403 0
404 0
405 0
406 0
407 0
408 0
409 0

[Matplotlib-users] the problem about axe

2009-05-14 Thread GoogleWind

hello everyone,

I have use maplotlib to show an image. the image is a map. 
The problem is when I zoom in the map, The extent of self.ax changes to fix
my selected. However, I want the extent of self.ax stand unchanged. Only the
map's extent changed. Is there any suggestion?

self.fig = Figure((8.8,6),facecolor='w')
self.canvas= FigureCanvasWxAgg(frame, -1, self.fig)   
self.ax= self.fig.add_axes([0.17,0.15,0.7,0.7],axisbg='#ff')
self.im = self.ax.imshow(Zm, norm = colors.Normalize(vmin =
valueSet[0], vmax = valueSet[1], clip =
False),cmap=palette,interpolation='nearest')

Thank you.
Huang.
-- 
View this message in context: 
http://www.nabble.com/the-problem-about-axe-tp23532518p23532518.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] the problem about axe

2009-05-14 Thread John Hunter
On Thu, May 14, 2009 at 8:44 AM, John Hunter  wrote:

> I'm not 100% what problem you are describing, but my hunch is that you
> want aspect='equal' as a kwarg to imshow.

Sorry, I meant aspect='auto'

JDH

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] the problem about axe

2009-05-14 Thread John Hunter
On Wed, May 13, 2009 at 7:50 PM, GoogleWind  wrote:
>
> hello everyone,
>
> I have use maplotlib to show an image. the image is a map.
> The problem is when I zoom in the map, The extent of self.ax changes to fix
> my selected. However, I want the extent of self.ax stand unchanged. Only the
> map's extent changed. Is there any suggestion?
>
>self.fig = Figure((8.8,6),facecolor='w')
>self.canvas= FigureCanvasWxAgg(frame, -1, self.fig)
>self.ax= self.fig.add_axes([0.17,0.15,0.7,0.7],axisbg='#ff')
>self.im = self.ax.imshow(Zm, norm = colors.Normalize(vmin =
> valueSet[0], vmax = valueSet[1], clip =
> False),cmap=palette,interpolation='nearest')

I'm not 100% what problem you are describing, but my hunch is that you
want aspect='equal' as a kwarg to imshow.

JDH

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-14 Thread Gökhan SEVER
Hello,

I have finally solved this riddle while reading the source code of boxplot
in axes.py file. And yes whisker plotting is done different than I expect.
When I assigned "whis" keyword to 3.0 the lower whisker is plotted on the
right spot. And Josh, yes you were right, it did plot the lower whisker as
seen on my very first uploaded image.

Still a question stays in my mind: How do you decribe box-whisker plots in
your writing while using matplotlib's boxplot command? It uses 25, 50, 75th
percentiles of the data for sure, but apart from what I expected whiskers
are not at 5th, and 95th percentiles of the data respectively.

Could someone please comment on this?

Gökhan


On Wed, May 13, 2009 at 8:43 PM, Gökhan SEVER  wrote:

> One more point to add.
>
> I issued one more boxplot with prctile(data) (a mlab command which boxplot
> calls internally to calculate percentiles) as an argument to it.
>
> Guess what?
>
> I get almost the same as in initially I have :) without a lower whisker.
>
> I don't know I am confusing myself or is it the data...
>
> Gökhan
>
>
>
> On Wed, May 13, 2009 at 7:56 PM, Gökhan SEVER wrote:
>
>> Ok,
>>
>> With this figure, it is clearer to see what's wrong with two of my
>> boxplots. I pull the original data and feed boxplot with it.
>>
>> The 1st boxplot is using only quartiles and the next is providing the
>> actual data array.
>>
>> http://img140.imageshack.us/img140/4705/boxplots.png
>>
>> To me the second boxplot seems more convenient to put an academic paper.
>> What do you think? These boxplots only show the variation in true air speed
>> of a small leg of a research flight.
>>
>> Would there be a better representation of in addition to / as an
>> alternative boxplotting?
>>
>> Gökhan
>>
>>
>>
>> On Wed, May 13, 2009 at 1:41 PM, Gökhan SEVER wrote:
>>
>>> Thank you for the response once again.
>>>
>>> That's why I am suspecting actually the raw data. At the problem points
>>> there might be not included values or missing values where not exist on the
>>> normal plots.
>>>
>>> I will find the original data and feed boxplot with it to see how it
>>> effects the final result.
>>>
>>> Gökhan
>>>
>>>
>>>
>>> On Wed, May 13, 2009 at 12:58 PM, Josh Hemann  wrote:
>>>

 Thanks for sending the data and code. After playing around some I still
 don't
 have a confident guess as to the problem (or solution), but here is what
 I
 would look at more...

 I issued   plot(d[i][8:])   for i 0,1,...11  and looked at the shape of
 the
 lines. For the two problem boxes, the plots of the associated data have
 steep jumps between the 5th and 25th percentiles, when compared with the
 data associated with the "good" boxes. So, what you have calculated as
 the
 5th and 25th percentiles are not necessarily calculated by boxplot as
 such
 because boxplot does not know that you are handing it percentiles of
 your
 underlying data: boxplot actually computes the percentiles assuming that
 the
 input _is_ the raw data. I would guess that if you gave boxplot the raw
 data
 you would not see this issue of missing whiskers.
 --
 View this message in context:
 http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23526653.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.



 --
 The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks
 to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
 i700
 Series Scanner you'll get full speed at 300 dpi even with all image
 processing features enabled. http://p.sf.net/sfu/kodak-com
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

>>>
>>>
>>
>
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] A request for code critique

2009-05-14 Thread Gökhan SEVER
Hello,

After solving the boxplotting mystery, and figuring out how to change the
mouse hover reading sensitivities, I have finished my small script which
creates boxplots from a given file. I can call it either by issueing
./splot.py file or from inside ipython -pylab with run command. However I
still couldn't figure out how to drop in ipython from the bash shell call
while all my variable context visible in the ipython namespace.

I am attaching the script and a sample file I used. Could you please comment
whether I am on the right track? I am not very sure my locals() use is
correct to create a variable name from a given file name. There might be
other points that seem weaker in the code as well.

Thank you.

Gökhan


09_03_23_11_44_54.stats.tas
Description: Binary data


splot.py
Description: Binary data
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] grayscale function

2009-05-14 Thread darkside
Hello,
First of all, I'm so sorry if I make a silly question or if it's explained
anywhere, buy I can't find help.

I have to do a grayscale figure for the function show in fig1, using a
density function, and obtain the picture from fig2.
I have tried a lot of things, but at the end I don't know how to do it.

The fig1 representes l vs vl(l) for different R values, but the density
depends on l and R, no on vl.
At the end, the only way I foud is: Make a grid,  for an R value,go through
all the [x,y] points, asking if the function vl is defined there and, if so,
calculating the density, and then adding the values for all the R.
It seems a really hard way of doing it, that's way I would like to know if
anyone have other idea.

I would be really thankful if anyone can help me, because I'm frustated with
this problem
Thank you very much,
Illa
<><>--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Canvas in wx.ScrolledPanel

2009-05-14 Thread Thomas Coudrat
Thank you gregor, it is now doing exactly what I want !

Thomas.


On Thu, May 14, 2009 at 5:12 AM, Gregor Thalhammer <
gregor.thalham...@gmail.com> wrote:

> Thomas Coudrat schrieb:
>
>> Hello list,
>>
>> I am new here an i need help on something : I am using Matplotlib in the
>> wxPython GUI, and i am trying to draw a BIG canvas, in a SMALL window, which
>> would be scrollable.
>> My implementation works if i use simple text too long for the size of the
>> window (see example file)
>> But the problem with the canvas is that is resizes to fit the window, and
>> i would like to be able to draw HUGE figures, which would be scrollable.
>> (in order print the figure, just uncomment the 3 lines, and comment the
>> wx.StaticText line)
>>
>> I hope i made my problem clear enough so that someone can help me out.
>>
>> Thanks in advance!
>>
> It seems to me your implementation already provides what you want. But if
> you want to show huge figures, you have to make them huge:
>
> fig = matplotlib.figure.Figure(figsize=(10,10))
>
> You could also try to inhibit scaling of the figure, box.Add(canvas, 0,
> wx.ALL), then the matplotlib figure inside the scrolled panel will always
> have the same size.
>
> Gregor
>
>
>
>
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-14 Thread Jouni K . Seppänen
Gökhan SEVER  writes:

> Still a question stays in my mind: How do you decribe box-whisker plots in
> your writing while using matplotlib's boxplot command? It uses 25, 50, 75th
> percentiles of the data for sure, but apart from what I expected whiskers
> are not at 5th, and 95th percentiles of the data respectively.

I'm too overwhelmed by other stuff to comment at length, but I don't
think the whiskers are usually expected to be at the 5th and 95th
percentiles:

http://en.wikipedia.org/wiki/Box_plot

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Annotations with pan / zoom

2009-05-14 Thread Jae-Joon Lee
On Thu, May 14, 2009 at 4:36 AM, Ben Coppin  wrote:
> Hi,
>
> I've added annotations to a graph I am producing using matplotlib. The
> annotations work fine, but when you zoom and pan, the annotations move off
> the edge of the chart and are still visible while they're in the main TK
> window. Does anyone know of a way to make the annotations disappear when
> they move off the edge of the chart?

Currently, there is no support for this. However, a monkey patching
can be a quick solution for now.


from matplotlib.text import Annotation

def draw(self, renderer):
x, y = self.xy
x, y = self._get_xy(x, y, self.xycoords)
if not self.axes.bbox.contains(x, y):
return

self.draw_real(renderer)

Annotation.draw_real = Annotation.draw
Annotation.draw = draw

ann = annotate("test", (0.5, 0.5), xytext=(0.6, 0.6),
   arrowprops=dict(arrowstyle="->"))


I think this should be the default behavior (with optionally turned
off). If other developers don't object, i'll try to push this feature
into the svn.

Regards,

-JJ


>
> Thanks,
>
> Ben
>
> --
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Annotations with pan / zoom

2009-05-14 Thread Ryan May
On Thu, May 14, 2009 at 2:03 PM, Jae-Joon Lee  wrote:

> On Thu, May 14, 2009 at 4:36 AM, Ben Coppin  wrote:
> > Hi,
> >
> > I've added annotations to a graph I am producing using matplotlib. The
> > annotations work fine, but when you zoom and pan, the annotations move
> off
> > the edge of the chart and are still visible while they're in the main TK
> > window. Does anyone know of a way to make the annotations disappear when
> > they move off the edge of the chart?
>
> Currently, there is no support for this. However, a monkey patching
> can be a quick solution for now.
>
>
> from matplotlib.text import Annotation
>
> def draw(self, renderer):
>x, y = self.xy
>x, y = self._get_xy(x, y, self.xycoords)
>if not self.axes.bbox.contains(x, y):
>return
>
>self.draw_real(renderer)
>
> Annotation.draw_real = Annotation.draw
> Annotation.draw = draw
>
> ann = annotate("test", (0.5, 0.5), xytext=(0.6, 0.6),
>   arrowprops=dict(arrowstyle="->"))
>
>
> I think this should be the default behavior (with optionally turned
> off). If other developers don't object, i'll try to push this feature
> into the svn.


You can't do this using the existing support for clipping artists?  I was
planning on cooking up an example that did just that, but haven't yet found
the time.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Annotations with pan / zoom

2009-05-14 Thread Jae-Joon Lee
>
> You can't do this using the existing support for clipping artists?  I was
> planning on cooking up an example that did just that, but haven't yet found
> the time.

What I want (and what I think is desirable) is that the annotation
should be drawn when (and only when) the xy coordinate is inside the
axes while the annotation text itself still can be outside the axes
(as in the attached image).
So, I don't think clipping is suitable here.

-JJ



>
> Ryan
>
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> Sent from Norman, Oklahoma, United States
<>--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Annotations with pan / zoom

2009-05-14 Thread Ryan May
On Thu, May 14, 2009 at 4:58 PM, Jae-Joon Lee  wrote:

> >
> > You can't do this using the existing support for clipping artists?  I was
> > planning on cooking up an example that did just that, but haven't yet
> found
> > the time.
>
> What I want (and what I think is desirable) is that the annotation
> should be drawn when (and only when) the xy coordinate is inside the
> axes while the annotation text itself still can be outside the axes
> (as in the attached image).
> So, I don't think clipping is suitable here


You're right, that makes sense.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] zero division: warning and exception

2009-05-14 Thread darkside
Hi list,
I have to make a division that sometimes yields and inf, and I want to
replace it by 0.
I have try this:
---
import pylab as p
p.seterr(divide='raise')
l = array vector defined along the program
try:
a = (dr*R*dl)/(1.-((R0/R)*p.sin(l))**2)**(1./2)
except FloatingPointError:
a=0
-
It works, but it doesn't return an array as expect, if some of the values
are zero, then a = 0.
So I tried:
--
a = p.zeros(len(l))
for i in range(len(l)):
try:
a[i] = (dr*R*dl)/(1.-((R0/R)*p.sin(l[i]))**2)**(1./2)
except FloatingPointError:
a[i]=0

But doing it this way I'm not able to get an exception:
array([ Inf])
And I don't know what I have to change to get an exception doing things this
way.

Thank you,
Illa
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] the problem about axe

2009-05-14 Thread GoogleWind

Yeah, Thank you.
This works. When I set aspect='auto', the im will not changed when I zoom in
or out.  However another problem appears. When I changed the size of the
frame. The length to width ratio is changed. So the map get an unexpected
shape.
Is there other suggestion to avoid this.

Huang.
-- 
View this message in context: 
http://www.nabble.com/the-problem-about-axe-tp23532518p23551697.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] the problem about axe

2009-05-14 Thread John Hunter
On Thu, May 14, 2009 at 7:59 PM, GoogleWind  wrote:
>
> Yeah, Thank you.
> This works. When I set aspect='auto', the im will not changed when I zoom in
> or out.  However another problem appears. When I changed the size of the
> frame. The length to width ratio is changed. So the map get an unexpected
> shape.
> Is there other suggestion to avoid this.


You need to try and explain more clearly what you want to happen under
what circumstances.  You should also want to read and experiment with
the the various aspect options (auto, equal, ...)

http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.set_aspect

JDH

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] zero division: warning and exception

2009-05-14 Thread John Hunter
On Thu, May 14, 2009 at 7:26 PM, darkside  wrote:
> Hi list,
> I have to make a division that sometimes yields and inf, and I want to
> replace it by 0.
> I have try this:
> ---
> import pylab as p
> p.seterr(divide='raise')
> l = array vector defined along the program
>     try:
>             a = (dr*R*dl)/(1.-((R0/R)*p.sin(l))**2)**(1./2)

Does your code fail with a ZeroDivisionError or simply fill the array
with infs.  You could try replacing the infs with zeros with

  mask = np.isinf(x)
  x[mask] = 0.


Eg,

In [1]: import numpy as np

In [2]: x = np.arange(0., 1., 0.1)

In [3]: y = 1/x

In [4]: y
Out[4]:
array([ Inf,  10.,   5.,   3.,
 2.5   ,   2.,   1.6667,   1.42857143,
 1.25  ,   1.])

In [5]: mask = np.isinf(y)

In [6]: y[mask] = 0.

In [7]: y
Out[7]:
array([  0.,  10.,   5.,   3.,
 2.5   ,   2.,   1.6667,   1.42857143,
 1.25  ,   1.])


JDH


>     except FloatingPointError:
>             a=0
> -
> It works, but it doesn't return an array as expect, if some of the values
> are zero, then a = 0.
> So I tried:
> --
> a = p.zeros(len(l))
>     for i in range(len(l)):
>         try:
>             a[i] = (dr*R*dl)/(1.-((R0/R)*p.sin(l[i]))**2)**(1./2)
>         except FloatingPointError:
>             a[i]=0
> 
> But doing it this way I'm not able to get an exception:
> array([ Inf])
> And I don't know what I have to change to get an exception doing things this
> way.
>
> Thank you,
> Illa
>
>
> --
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] APLpy 0.9.1 Release

2009-05-14 Thread Astronomical Python
We are pleased to announce the release of APLpy 0.9.1, which includes
bug fixes, improvements, and new features.

APLpy is a python module that makes it easy to interactively produce
publication-quality plots of astronomical images in FITS format. More
details are available at

http://aplpy.sourceforge.net/

>From the front page you can sign up to the mailing list and/or the Twitter
feed to be kept up-to-date on future releases.

Cheers,

Eli Bressert and Thomas Robitaille

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] zero division: warning and exception

2009-05-14 Thread Armin Moser
darkside schrieb:
> Hi list,
> I have to make a division that sometimes yields and inf, and I want to
> replace it by 0.
> I have try this:
> ---
> import pylab as p
> p.seterr(divide='raise')
> l = array vector defined along the program
> try:
> a = (dr*R*dl)/(1.-((R0/R)*p.sin(l))**2)**(1./2)
> except FloatingPointError:
> a=0
> -
> It works, but it doesn't return an array as expect, if some of the values
> are zero, then a = 0.
> So I tried:
> --
> a = p.zeros(len(l))
> for i in range(len(l)):
> try:
> a[i] = (dr*R*dl)/(1.-((R0/R)*p.sin(l[i]))**2)**(1./2)
> except FloatingPointError:
> a[i]=0
> 
> But doing it this way I'm not able to get an exception:
> array([ Inf])
> And I don't know what I have to change to get an exception doing things this
> way.
You can do it that way:
a = rand(5,5)
b = a.round()
c = a/b
c[isinf(c)] = 0 # use indexing with boolean array [1] to set zero

In your case:
a = (dr*R*dl)/(1.-((R0/R)*p.sin(l))**2)**(1./2)
a[isinf(a)] = 0

HTH
Armin

[1]

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users