Fill closed plot on graph?

I have a plot (close loop) which I'd like to fill with either a solid color or a pattern. Using the menu commands, which show up as:

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
It looks like you're using Fill To Zero mode. I think you need Fill To Next. For help, execute this:
DisplayHelpTopic "Grouping, Stacking and Adding Modes"

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.
I've been exploring the various modes and have not been able to get it to do what I want. So I have attached the pxp and csv data file.

I also tried splitting the closed loop into two curves, but no luck.

DN
mw_plot.zip
I misunderstood. The fill modes for graph traces will not help you because they fill to Y=0 or to another trace.

You want a filled polygon. For this you need to use drawing tools. Here are the commands I used:

// Remove y2a trace - we will use drawing tools instead
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:
DisplayHelpTopic "DrawPoly"


For information on drawing layers:
DisplayHelpTopic "Drawing Layers"


For general information on drawing:
DisplayHelpTopic "Drawing"


Thanks. I had in the interim used the drawing tools, but manually. It's great to know how to automate that.