03-20-2012 10:09 AM
Using gcontour to create a plot with grid lines showing, I get plots in which the grid lines appear in front of the contour lines. Since the grid lines are light gray and the contours are black, this visually looks like the contour lines have breaks in them. Depending on the shape of the contours, the pattern of breaks is quite obvious and distracting, and can even create a Moire effect. I have also tried href and vref lines, but they also break contour lines. Is there a way to put the grid (or ref) lines behind the contours?
I'm also using grid lines with gplot and i=join, in which case the grid appears behind the plotted curves and it looks fine.
proc gcontour data=example;
plot y*x=z / nolegend autolabel levels=0 to 5 by 0.5 grid;
03-20-2012 01:05 PM
One work-around would be to annotate the grid/reflines, using when='b' to draw them before/behind the rest of the graph...
do x_loop=0 to 10 by 2.5;
function='move'; x=x_loop; y=0; output;
function='draw'; y=100; output;
do y_loop=0 to 7 by 1.75;
function='move'; y=y_loop; x=0; output;
function='draw'; x=100; output;
proc gcontour data=sashelp.lake anno=anno_grid;
plot length*width=depth / nolegend autolabel
levels=-10 to 0 by 2;
03-21-2012 09:52 AM
Yes, and it is probably worth doing if there is not an easier way. Thanks - it was kind of you to take the trouble to write it out, too.
I am going to wait a little while to see if somebody comes up with an easier way, but if not, I will annotate the graph. I was already wondering if I had to use annotation to solve another problem about uneven tick marks, which I will post in another thread.