|
From: Jonathan S. <js...@cf...> - 2011-09-15 13:34:06
|
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 |
|
From: Jae-Joon L. <lee...@gm...> - 2011-09-17 13:01:51
Attachments:
contour_to_hatched_patches.py
|
On Thu, Sep 15, 2011 at 10:33 PM, Jonathan Slavin <js...@cf...> 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. > 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 > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: spencerahill <spe...@gm...> - 2012-12-05 17:28:44
|
Jae-Joon Lee wrote > On Thu, Sep 15, 2011 at 10:33 PM, Jonathan Slavin > < > jslavin@.harvard > > 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@.sourceforge > 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> 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. |
|
From: Phil E. <pel...@gm...> - 2012-12-05 17:47:09
|
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 <spe...@gm...> wrote: > Jae-Joon Lee wrote > > On Thu, Sep 15, 2011 at 10:33 PM, Jonathan Slavin > > < > > > jslavin@.harvard > > > > 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@.sourceforge > > > 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> > ; > > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |