hans.bering | 1 Jul 10:23 2011
Picon

Re: "bad screen distance" tkinter error with German locale


Hi,

thanks for the very quick response & fix. We were surprised, too, that we hadn't found more about this
problem. We were put on the right track by this related report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395867 - Thanks also for the link to the other
report. I'll see if I can come up with a nice example and submit it there.

Cheers
HB

> On 06/30/2011 01:10 PM, Michael Droettboom wrote:
> > I'm surprised this bug (which really lies in Tkinter) isn't more widely
> > known -- searching the Python bug tracker revealed nothing.  It would be
> > great to follow-up there (with a standalone Tkinter-crashing example) if
> > you're so inclined.
> I did find this bug, which seems to be related.
> 
> http://bugs.python.org/issue10647
> 
> Mike

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
marz_cyclone | 1 Jul 16:52 2011
Picon

bbox of map


hi all,

i'm trying to get the bounding box of a map plotted with basemap to place a
colorbar. in this reduced example from the example directory of basemap, the
colorbar is set to the hight of the axes of the plot. 

from mpl_toolkits.basemap import Basemap, shiftgrid
import numpy as np
import matplotlib.pyplot as plt

topoin = np.loadtxt('etopo20data.gz')
lons = np.loadtxt('etopo20lons.gz')
lats = np.loadtxt('etopo20lats.gz')

topoin,lons = shiftgrid(180.,topoin,lons,start=False)

m = Basemap(llcrnrlon=-57,llcrnrlat=37,urcrnrlon=-3,urcrnrlat=60,
            resolution='i',projection='tmerc',lon_0=-41,lat_0=45)
# transform to nx x ny regularly spaced native projection grid
nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1
topodat,x,y = m.transform_scalar(topoin,lons,lats,nx,ny,returnxy=True)
# create the figure.
fig=plt.figure(figsize=(8,8))
# add an axes, leaving room for colorbar on the right.
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# associate this axes with the Basemap instance.
m.ax = ax
# plot image over map with imshow.
im = m.imshow(topodat,plt.cm.jet)
(Continue reading)

Mlab - Rec_Summarize / Rec_GroupBy

Good morning –

 

Got a question for a mlab module guru.

 

After some experimentation (and judicious peeking at the source code), I think I’ve got the hang of writing custom functions to pass into these modules – basically, anything that accepts a list of values sliced from a single column on the structured array and returns a single list seems to work well. In functional programming terms, rec_summarize appears similar to “map”, rec_groupby appears similar to “reduce”.

 

Now – what if I want to derive a calculation from multiple statistics in the original dataset – eg. create a new column on the array which is derived from 2 (or up to n) other fields in a custom function which I pass into the process?

 

For example, conditional counts/summaries (count transactions and sum the sales on all orders that weighed > 5K lbs).

 

Is there a way to do this within numpy or mlab without going all the way out to python and creating a list comprehension?

 

Thanks.

 

John

 

 

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
John Hunter | 1 Jul 20:26 2011
Picon

Re: Mlab - Rec_Summarize / Rec_GroupBy

On Fri, Jul 1, 2011 at 11:14 AM, Hackett, John (Norcross, GA)
<John.Hackett@...> wrote:
> After some experimentation (and judicious peeking at the source code), I
> think I’ve got the hang of writing custom functions to pass into these
> modules – basically, anything that accepts a list of values sliced from a
> single column on the structured array and returns a single list seems to
> work well. In functional programming terms, rec_summarize appears similar to
> “map”, rec_groupby appears similar to “reduce”.
>
>
>
> Now – what if I want to derive a calculation from multiple statistics in the
> original dataset – eg. create a new column on the array which is derived
> from 2 (or up to n) other fields in a custom function which I pass into the
> process?
>
>
>
> For example, conditional counts/summaries (count transactions and sum the
> sales on all orders that weighed > 5K lbs).
>
>
>
> Is there a way to do this within numpy or mlab without going all the way out
> to python and creating a list comprehension?

There are a couple of ways with the existing functions.

One is to use a logical mask::

   mask = r.weight>5
   rg = mlab.rec_groupby(r[mask], groupby, stats)

You could also create a new categorical variable with one or more
values and attach it to your record array and then use rec_groupby::

  heavy = np.where(r.weight>5, 1, 0)

and add that to your record array

  r = mlab.rec_append_fields(r, ['heavy'], [heavy])

and then do a rec_group_by using 'heavy' as your group by attribute.

Brian Schwartz has a preliminary implementation of rec_query which
allows you to make a SQL query on a record array by converting it to a
sqllite table, running the sql query, and returning the results as a
new record array, which would solve your problem more cleanly and
generically.  The code needs a little more polishing, but perhaps
Brian you can send over what you have in case John wants to take a
look.

JDH

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Yang-Le Wu | 1 Jul 22:31 2011
Picon

Re: "undefined symbol" error message when importing frommatplotlib._path

Frank Thommen <frank.thommen <at> ...> writes:
> undefined symbol: 
> _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
>  >>> exit()

Hi Frank,

I ran into exactly the same error when I tried to install matplotlib from 
source. It turned out that the problem in my case was caused by some 
system library prebuilt with a different version of gcc -- switching back 
from building matplotlib with gcc44 to gcc41 solved my problem. I didn't 
check exactly which library is to blame, though.

Hope it helps.

-Yangle

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Brian Blais | 1 Jul 23:34 2011

bug, or am I doing something wrong?

I was playing with interpolation, and this little script does something weird with interpolation.  for
N<30000 everything is ok.  after 30000 it is white...it draws the image, but then every point from 30000 on
is white (so with N=60000 the plot is half white).  matplotlib 1.01 from enthought distribution 7.  am I
doing something wrong?  seems to only affect interpolation nearest.

		thanks!

			bb

from pylab import *

N=50000

im=randn(20,N)
figure(1)

subplot(2,1,1)
imshow(im,
    aspect='auto',
    )

subplot(2,1,2)
imshow(im,
    cmap=cm.hot,
    aspect='auto',
    interpolation='nearest',
    )

draw()

--

-- 
Brian Blais
bblais@...
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Eric Firing | 2 Jul 02:06 2011

Re: bug, or am I doing something wrong?

On 07/01/2011 11:34 AM, Brian Blais wrote:
> I was playing with interpolation, and this little script does something weird with interpolation.  for
N<30000 everything is ok.  after 30000 it is white...it draws the image, but then every point from 30000 on
is white (so with N=60000 the plot is half white).  matplotlib 1.01 from enthought distribution 7.  am I
doing something wrong?  seems to only affect interpolation nearest.
>

You are not doing anything wrong; this looks like a limitation in Agg, 
pertaining only to the horizontal, not the vertical.  I suspect 
something is being done with a signed 2-byte integer limit.  As a 
workaround, subsample your array when the x-dimension gets too big. 
Probably we should modify mpl to do that automatically so that we don't 
hit this limit.

Eric

>
> 		thanks!
>
> 			bb
>
> from pylab import *
>
> N=50000
>
> im=randn(20,N)
> figure(1)
>
> subplot(2,1,1)
> imshow(im,
>      aspect='auto',
>      )
>
> subplot(2,1,2)
> imshow(im,
>      cmap=cm.hot,
>      aspect='auto',
>      interpolation='nearest',
>      )
>
> draw()
>
>
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Michiel de Hoon | 2 Jul 08:37 2011
Picon

Re: animations in macosx/wxagg

Dear Chris,

> - can the native macos backend be used for animation?

Yes.

> What's the
> equivalent of gobject.idle_add or gobject.timeout_add?

If you use the recent backend-independent animation code, you won't need those. See
examples/animation/simple_anim.py on github for an example (this code is not yet in an official
release). However, blitting won't work, so you'll need to switch that off.

> Anything special needed for the blitting approach to work?

Currently it won't work with the MacOSX backend. For blitting to work with the MacOSX backend, we won't just
need changes to the backend code (which is relatively straightforward) but also to the upstream
lib/matplotlib/animation.py code. We will need to rethink the logic of blitting with animation, in
particular when to store the figure to be blitted, and when to do the actual blitting. In the current
version of lib/matplotlib/animation.py, the figure to be blitted gets stored after the figure is
modified but before the screen is updated. With the other backends, this results in the unmodified figure
being stored; with the MacOSX backend, this results in the modified figure being stored, so if you then
blit it you will see an incorrect background.

--Michiel.

> 
> - What needs to be done to get WXAgg blitting? I have code
> like this:
> ...
> matplotlib.use('WXAgg')
> ...
> def update():
>     ...
>     # restore, blit etc
>     wx.WakeUpIdle()
> 
> ...
> wx.EVT_IDLE(wx.GetApp(), update)
> ...
> 
> On Linux this draws the first screen and pauses. If I move
> the mouse
> around I see the updates. As soon as I stop, so do the
> updates. What
> am I missing? (BTW I get the same behaviour from
> animation_blit_wx.py
> from the examples page). This is 1.0.1 on Linux, although
> I'm still
> using 0.99.1 as well.
> 
> thanks for any help,
> 
> cheers, chris
> 
> 
> 
> 
> 
> -- 
> Chris Higgins, Omnisense Ltd, 3rd Floor, St. Andrews
> House,
> 59 St Andrews Street, Cambridge, CB2 3BZ
> Office: +44 (0) 1223 651394
> Mobile: +44 (0) 780 490 8562
> Skype: chiggins99
> http://www.omnisense.co.uk
> 
> Omnisense Ltd is a company registered in England and Wales.
> Registered number: 6779286.
> Registered office: St. Andrews House, 59 St Andrews Street,
> Cambridge, CB2 3BZ
> 
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is
> seriously valuable.
> Why? It contains a definitive record of application
> performance, security 
> threats, fraudulent activity, and more. Splunk takes this
> data and makes 
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
JonBL | 2 Jul 05:02 2011
Picon

Exceptions on Some Demos


I've used Add/Remove Software to install
python-matplotlib-0.98.5.2-2.fc10(i386) and
python-matplotlib-tk-0.98.5.2-2.fc10(i386) on my fedora 10 box, plus 11
dependencies, including Tkinter. Some matplotlib examples, eg pylab_examples
Examples/arctest.py works nicely, but many do not as presented.

Example api Examples/barchart_demo raises the following traceback when
executed as-is:

[jon <at> einstein matplotlib-examples]$ ./barchart.py
Traceback (most recent call last):
  File "./barchart.py", line 18, in <module>
    error_kw=dict(elinewidth=6, ecolor='pink'))
  File "/usr/lib/python2.5/site-packages/matplotlib/pyplot.py", line 1656,
in bar
    ret =  gca().bar(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 4075, in
bar
    r.update(kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/artist.py", line 548, in
update
    raise AttributeError('Unknown property %s'%k)
AttributeError: Unknown property error_kw

(I've copied the example code into script barchart.py, and run it from
there.) 

The problem line is:

rects1 = plt.bar(ind, menMeans, width,
                    color='r',
                    yerr=menStd,
                    error_kw=dict(elinewidth=6, ecolor='pink'))

If I replace this with:

rects1 = plt.bar(ind, menMeans, width,
                    color='r',
                    yerr=menStd)

and do the same thing for the rects2 statement, the demonstration then
presents the bar chart.

The problem seems to lie somewhere with the error_kw arg being passed to
method plt.bar. Is there something else I need to do to get the provided
examples to work as coded?

TIA,
  Jon
--

-- 
View this message in context: http://old.nabble.com/Exceptions-on-Some-Demos-tp31977899p31977899.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Francois Lemery | 1 Jul 20:35 2011
Picon

4D Scatter Plot

Hello,

I am interested in producing a 4 dimensional plot to represent some data.

I picture this as looking like a normal 3d scatter plot with datapoints varying in a color scale which depends on a fourth column of data.

Could anyone help me with this- I have searched google and the matplotlib website and have only found some documentation for a MatLab solution bywhich I am not interested.

Thank you kindly!
-Francois


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Gmane