How to create a filled polygon ?

41 views
Skip to first unread message

Uwe Schmitt

unread,
Sep 22, 2015, 1:20:59 PM9/22/15
to guidata/guiqwt
Hi,

I managed to create a polygon using 

 
shape = PolygonShape(points, closed=True)


but I do not know how to set the

shapeparam

argument so that the plotted polygon will have a transparent filing.
Any help is very appreciated.

Best, Uwe

Russ Berg

unread,
Sep 25, 2015, 4:51:24 PM9/25/15
to guidata...@googlegroups.com

Hi Uwe, here is a function I wrote to create rectangles that shows how the shapeparam is set.

-Russ

 

def create_rectangle(self, rect, title='None'):

       r = make.rectangle(rect[0], rect[1], rect[2], rect[3], title=title)

       sh = r.shapeparam

       sh.fill.alpha = 0.05

       sh.sel_fill.alpha = 0.05

       sh.symbol.alpha = 0.05

       sh.sel_symbol.alpha = 0.05

      

       sh.symbol.marker = 'NoSymbol'   

       sh.sel_symbol.marker = 'NoSymbol'

       r.set_item_parameters({"ShapeParam":sh})

      

       self.plot.add_item(r)

 

 

From: guidata...@googlegroups.com [mailto:guidata...@googlegroups.com] On Behalf Of Uwe

Schmitt
Sent: September-22-15 11:21 AM
To: guidata/guiqwt
Subject: [guidata/guiqwt] How to create a filled polygon ?

--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqw...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages