Hi,

While playing a little bit with "custom_projection_example.py", I
found that "plot" command with projection="hammer" plots too many
markers.

For example,

    subplot(111, projection="hammer")
    grid(True)
    p = plot([-1, 1, 1], [-1, -1, 1], "o")
    show()

plots more than 100 circles, instead of 3. And I presume that this is
a bug not a feature.
This seems to be because the draw() method of the Line2D class  uses
self._transformed_path for plotting Markers, but  number of vertices
in the _transformed_path increases in the curved coordinate system as
in the example.

A patch to fix this is attached. It defines a new property
"self._transformed_path_mark" in the recache() method as follows

        tr = self.get_transform()
        self._transformed_path = TransformedPath(self._path, tr)
        self._transformed_path_mark =
Path(tr.transform_non_affine(self._path.vertices))


and draw() method uses this for plotting markers.

                tpath, affine = self._transformed_path_mark, \
                                self.get_transform().get_affine()

As I'm not 100% sure about how the transform things work, I may have
missed something. But I got correct results for cases I tried.
So I hope this patch is reviewed and applied.

Regards,

-JJ

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to