Fill closed plot on graph?
dcnicholls
ModifyGraph hbFill(y2a)=49,plusRGB(y2a)=(17476,17476,17476)
ModifyGraph mode(y2a)=7
it splatters the fill across the borders. See attached screen shot, with the plot shown in red.
Is there a way to fill just the red plot?
DN
If you can't get it to work, if feasible, save your graph to a .pxp file (File->Save Graph Copy) and attach the resulting file to a post here so we can play with it.
Also specify what OS and what version of Igor you are using in case there is a bug involved.
December 5, 2010 at 03:47 pm - Permalink
December 5, 2010 at 03:49 pm - Permalink
I also tried splitting the closed loop into two curves, but no luck.
DN
December 5, 2010 at 06:44 pm - Permalink
You want a filled polygon. For this you need to use drawing tools. Here are the commands I used:
RemoveFromGraph y2a
// Direct drawing to the User Front layer
// If you do this programmatically, you may want to use ProgFront instead
SetDrawLayer UserFront
// Use axis coordinates for drawing elements
SetDrawEnv xcoord=bottom,ycoord=left
// Set current line color to red
SetDrawEnv linefgc=(65535,0,0)
// Set current foreground fill color to gray
SetDrawEnv fillfgc=(43690,43690,43690)
// Draw polygon using x2a and y2a coordinates
DrawPoly x2a[0],y2a[0],1,1,x2a,y2a
Note that I used a gray color fill instead of a pattern. You can change this by showing the drawing tools, double-clicking the polygon, and using the resulting dialog.
For information on the DrawPoly operation, execute this:
For information on drawing layers:
For general information on drawing:
December 5, 2010 at 07:57 pm - Permalink
December 6, 2010 at 12:12 am - Permalink