Marker positioning accuracy

The positioning of markers seems a bit off, especially when a line is moved around with the pan and zoom tool. They don't follow the line they are in, and seem to follow a much lower resolution line. Try the following example, and use the pan and zoom tool to move the lines around.

mpl svn rev 7310 / Ubuntu 9.04 / GTKAgg

Regards,
Jo�o Silva

···

---------------------------------------------------------------------

import numpy as np
import matplotlib.pyplot as plt

delta = 0.2
x = np.arange(-5,5,0.05)
plt.plot(x,x,marker="o")
plt.plot(x,x+delta,"g",lw=1.5)
plt.plot(x,x-delta,"g",lw=1.5)
ax = plt.gca()
ax.set_xlim((-4.25,4.7))
ax.set_ylim((-5.5,5.1))
plt.show()

---------------------------------------------------------------------

That is by design -- it's a performance vs. accuracy tradeoff. Markers are drawn only once and then stamped to the nearest pixel boundaries. What you're seeing is the result of this rounding. And since each marker is rounded in isolation, you don't see smooth stepping as a classical line drawing algorithm (such as Breshenham's) would give. We could make this behavior optional, but it would require a significantly different code path in the Agg backend. The Agg backend is generally optimized for interactive performance, not accuracy. For accuracy, one can use any of the vector output formats.

Cheers,
Mike

Jo�o Lu�s Silva wrote:

···

The positioning of markers seems a bit off, especially when a line is moved around with the pan and zoom tool. They don't follow the line they are in, and seem to follow a much lower resolution line. Try the following example, and use the pan and zoom tool to move the lines around.

mpl svn rev 7310 / Ubuntu 9.04 / GTKAgg

Regards,
Jo�o Silva

---------------------------------------------------------------------

import numpy as np
import matplotlib.pyplot as plt

delta = 0.2
x = np.arange(-5,5,0.05)
plt.plot(x,x,marker="o")
plt.plot(x,x+delta,"g",lw=1.5)
plt.plot(x,x-delta,"g",lw=1.5)
ax = plt.gca()
ax.set_xlim((-4.25,4.7))
ax.set_ylim((-5.5,5.1))
plt.show()

---------------------------------------------------------------------

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA