Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to draw polygon on contour plot

46 views
Skip to first unread message

erida...@gmail.com

unread,
Apr 10, 2020, 12:14:32 AM4/10/20
to
I would like to draw a polygon on "top of" a contour plot. My code sample below "almost" gets there; I can see the polygon lines around the edges of the plot, but not the diagonal lines connecting the edge lines. The only reason I can see the edge lines is because I plotted with a line width of 5. The contour coloring seems to cover the diagonal lines.

I don't see a way to attach an image to my post to show the problem in the resulting plot:(


[code]
f="PlywoodSpace.csv"
reset
set term windows size 800,1100
set pm3d

set dgrid3d
unset surface # don't need surfaces
set view map
set contour
set key outside
set cntrparam cubicspline # smooth out the lines
set cntrparam levels 50 # 50 sets the num of contour lines
set pm3d interpolate 20,20 # interpolate the color
# Set a nice color palette
set palette model RGB defined ( 0"black", 1"blue", 2"purple", 3"cyan", 4"green", 5"yellow", 6"red", 7"white" )
set title "Plywood"

# draw a paddle
set object 1 polygon from -2.5,-4,99 to -3,-3,99 to -3,4,99 to -2.5,5,99 to 2.5,5,99 to 3,4,99 to 3,-3,99 to 2.5,-4,99 lw 5 fc rgb "red"

# Axes
set tics scale 1,0.2
set format z '%.0f'
unset xtics
unset ytics

# Now plot
splot f using 1:2:3 notitle with lines lt 1

[/code]

erida...@gmail.com

unread,
Apr 12, 2020, 7:14:01 PM4/12/20
to
Tried a million differrent things to try and get the polygon object to show up on top. Finally figured out to
do splot
now define the object polygon with "front"
replot

Now the object shows up higher than than the contour.
0 new messages