how to shrink a numarray array?



To draw a large array of data on a small panel, I need to shrink it to a
given size. e.g:

To draw numarray.arange(10000) on a panel of width of 100, I only need
to draw the points of (0, 100, 200, 300, ...) instead of (0, 1, 2, ...).
So I need a method to shrink it to an 100-item array.

x[::len(x)/panel_width] will not work. If the panel's width is 60, that
expression will return an array of 61 elements.

I believe there is an existing function in numarray to do this, however
English is not my mother tongue and math is not my speciality, I can't
find it in the document full of math terms...

--
Qiangning Hong

______________________________________________
( Michael: )
( )
( Hi. I'm Michael Jackson, from The Jacksons. )
( )
( Homer: I'm Homer Simpson, from the Simpsons. )
( )
( Stark Raving Dad )
----------------------------------------------
o
o \
\ /\
( )
.( o ).
.



Relevant Pages

  • Re: Nearest point to the mouse cursor?
    ... > It is very easy to get X and Y coordinates when the cells are rectangles: ... > that pattern is represented in the Rows array. ... >> I'm also drawing the hexcells in a panel, not a form and although I've ... > you draw your 50X50 board to the bitmap, and then copy it over to the panel ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Nearest point to the mouse cursor?
    ... current X or Y mouse position by the size of the cell give the cell's ... It is an array of arrays. ... and 1 were only used during the draw process to help ... > a nice big red block on the panel screen. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: using the mouse
    ... Catch the WM_PAINT message of the window you want to draw the lines ... >> and draw them using the points in array. ... >> AliR. ...
    (microsoft.public.vc.mfc)
  • Re: CPoint Help
    ... >I cannot get my CPoint pointarray to draw lines based on the criteria ... > int y = 0; ... > dResult = sin; ...
    (microsoft.public.vc.mfc)
  • Re: Drawing on TBitmaps canvas always shows white? - Part 2
    ... I have an array of pixels ... >> problem I have is when I want to draw these pixels on the canvas. ...
    (alt.comp.lang.borland-delphi)