where's draw_point gone ?

Hi,

in matplotlib 0.91 there was a function draw_point for the backends. This seems to be gone (except for backend_agg2.py and backend_emf.py !?). I guess it wasn't used very often; instead I see that there is now a function draw_point in lines.py. Is it possible to re-add this functionality to the backends ??? What I would need is a function that draws a single pixel to a device.

The reason why I'm asking is that I have thought about an additional scatter marker m=(0,0) that draws single pixels (as fast as possible). Such a marker might be very useful when drawing lots and lots of data-point on in a single plot. A typical application might be to draw the positions of particles in an N-Body simulation. My current best approach is to use "scatter(x,y, s=0.1)", but I think that an optimized routine would be very helpful.

So my main questions are:
- Why was draw_point removed ?
- Can it be re-added again?

Manuel

The markerstyle for drawing a pixel is ',' and it is supported across
backends AFAIK

In [1]: plot(rand(1000), ',')
Out[1]: [<matplotlib.lines.Line2D instance at 0x8e6c12c>]

In [2]: savefig('test.png')

In [3]: savefig('test.pdf')

In [4]: savefig('test.eps')

In [5]: savefig('test.svg')

JDH

···

On Thu, Apr 3, 2008 at 8:40 AM, Manuel Metz <mmetz@...459...> wrote:

Hi,

in matplotlib 0.91 there was a function draw_point for the backends.
This seems to be gone (except for backend_agg2.py and backend_emf.py
!?). I guess it wasn't used very often; instead I see that there is now
a function draw_point in lines.py. Is it possible to re-add this
functionality to the backends ??? What I would need is a function that
draws a single pixel to a device.

John Hunter wrote:

Hi,

in matplotlib 0.91 there was a function draw_point for the backends.
This seems to be gone (except for backend_agg2.py and backend_emf.py
!?). I guess it wasn't used very often; instead I see that there is now
a function draw_point in lines.py. Is it possible to re-add this
functionality to the backends ??? What I would need is a function that
draws a single pixel to a device.

The markerstyle for drawing a pixel is ',' and it is supported across
backends AFAIK

Hi John,
thank - that's done via the draw_point in lines.py, right? Now, as far as I can see this function "emulates" to draw one pixel by drawing a line of length 1 pixel. I was just wondering whether its worth to have a draw_point method for (pixel-based) backends (png) that have an intrinsic command to draw one pixel which might be more efficient.

But if it's done with lines for all the backends, this means that draw_point() can be removed from the two files backend_agg2.py and backend_emf.py !?

Manuel

···

On Thu, Apr 3, 2008 at 8:40 AM, Manuel Metz <mmetz@...459...> wrote:

Manuel Metz wrote:

John Hunter wrote:
  

Hi,

in matplotlib 0.91 there was a function draw_point for the backends.
This seems to be gone (except for backend_agg2.py and backend_emf.py
!?). I guess it wasn't used very often; instead I see that there is now
a function draw_point in lines.py. Is it possible to re-add this
functionality to the backends ??? What I would need is a function that
draws a single pixel to a device.
      

The markerstyle for drawing a pixel is ',' and it is supported across
backends AFAIK
    
Hi John,
thank - that's done via the draw_point in lines.py, right? Now, as far as I can see this function "emulates" to draw one pixel by drawing a line of length 1 pixel. I was just wondering whether its worth to have a draw_point method for (pixel-based) backends (png) that have an intrinsic command to draw one pixel which might be more efficient.
  

In Agg at least, it won't be much more efficient -- the marker is drawn only once and then blitted multiple times. There's some overhead for the blitting loop, for sure, but not much -- probably not enough to warrant complicating the code. But, I say that without any experiments, so I'm happy to be proven wrong.

But if it's done with lines for all the backends, this means that draw_point() can be removed from the two files backend_agg2.py and backend_emf.py !?
  

Both of those backends are deprecated anyway -- probably best to just remove the backends altogether... :wink:

Mike

···

On Thu, Apr 3, 2008 at 8:40 AM, Manuel Metz <mmetz@...459...> wrote:

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA