cross hatching in contours?

I'm wondering if there is some way to do cross hatching as a way to fill
contours rather than colors (using contourf). The only references to
cross hatching I see in the documentation are for patches type objects.
As far as I can tell, contour and contourf return objects of their own
type (contour.QuadContourSet) that do not have hatch as an attribute.

If it's not possible currently, how hard would it be to add that
capability to contourf? What approach would you recommend?

Regards,
Jon

I'm wondering if there is some way to do cross hatching as a way to fill
contours rather than colors (using contourf). The only references to
cross hatching I see in the documentation are for patches type objects.
As far as I can tell, contour and contourf return objects of their own
type (contour.QuadContourSet) that do not have hatch as an attribute.

Yes, it seems that hatching is only supported in patches.
You may workaround this by converting contours to multiple patches.
See the attachment.

If it's not possible currently, how hard would it be to add that
capability to contourf? What approach would you recommend?

It may not be that difficult, but seems to require an api change
(e.g., draw_path_collections).
Can you file an issue on our github page?

Regards,

-JJ

contour_to_hatched_patches.py (1.1 KB)

···

On Thu, Sep 15, 2011 at 10:33 PM, Jonathan Slavin <jslavin@...1081...> wrote:

Regards,
Jon

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Jae-Joon Lee wrote

On Thu, Sep 15, 2011 at 10:33 PM, Jonathan Slavin
&lt;

jslavin@...4251...

&gt; wrote:

I'm wondering if there is some way to do cross hatching as a way to fill
contours rather than colors (using contourf). The only references to
cross hatching I see in the documentation are for patches type objects.
As far as I can tell, contour and contourf return objects of their own
type (contour.QuadContourSet) that do not have hatch as an attribute.

Yes, it seems that hatching is only supported in patches.
You may workaround this by converting contours to multiple patches.
See the attachment.

Matplotlib-users mailing list

Matplotlib-users@...4252...

matplotlib-users List Signup and Options

contour_to_hatched_patches.py (1K)
&lt;http://matplotlib.1069221.n5.nabble.com/attachment/23/0/contour_to_hatched_patches.py&gt;

Hi Jae-Joon,

Your contour_to_hatched_patches.py script works excellently. Is there a way
to suppress the contour lines and filling, leaving only stippling? I have
been experimenting with it but no luck.

I have a contourf of a 2D variable and a separate 2D array indicating
regions of statistical significance (i.e. a mask, which equals 1 in cells
where the variable is significant and equals 0 else), and I want to put
black hatching over the contourf where it is significant. I can get this to
work, but still with a black contour line surrounding the hatched region.
I'd like to remove the line, leaving just the hatching. Thanks!

Best,
Spencer

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/cross-hatching-in-contours-tp22p39945.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

As of matplotlib v1.2.0 you can hatch a contour set directly. There is an example in the gallery:

http://matplotlib.org/examples/pylab_examples/contourf_hatching.html

···

Hope that helps,

Phil

On 5 December 2012 17:28, spencerahill <spencerahill@…287…> wrote:

Jae-Joon Lee wrote

On Thu, Sep 15, 2011 at 10:33 PM, Jonathan Slavin

<

jslavin@…4251…

> wrote:

I’m wondering if there is some way to do cross hatching as a way to fill

contours rather than colors (using contourf). The only references to

cross hatching I see in the documentation are for patches type objects.

As far as I can tell, contour and contourf return objects of their own

type (contour.QuadContourSet) that do not have hatch as an attribute.

Yes, it seems that hatching is only supported in patches.

You may workaround this by converting contours to multiple patches.

See the attachment.

Matplotlib-users mailing list

Matplotlib-users@…4252…

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

contour_to_hatched_patches.py (1K)

<http://matplotlib.1069221.n5.nabble.com/attachment/23/0/contour_to_hatched_patches.py&gt;

Hi Jae-Joon,

Your contour_to_hatched_patches.py script works excellently. Is there a way

to suppress the contour lines and filling, leaving only stippling? I have

been experimenting with it but no luck.

I have a contourf of a 2D variable and a separate 2D array indicating

regions of statistical significance (i.e. a mask, which equals 1 in cells

where the variable is significant and equals 0 else), and I want to put

black hatching over the contourf where it is significant. I can get this to

work, but still with a black contour line surrounding the hatched region.

I’d like to remove the line, leaving just the hatching. Thanks!

Best,

Spencer

View this message in context: http://matplotlib.1069221.n5.nabble.com/cross-hatching-in-contours-tp22p39945.html

Sent from the matplotlib - users mailing list archive at Nabble.com.


LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial

Remotely access PCs and mobile devices and provide instant support

Improve your efficiency, and focus on delivering more value-add services

Discover what IT Professionals Know. Rescue delivers

http://p.sf.net/sfu/logmein_12329d2d


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users