我在wxmaxima中生成了一个等高线图,并希望在顶部绘制一个多边形(由其角点定义)。 这样的事情,但在一个情节中:
lx:[-0.5,1.5,2,-1.5]$
ly:[-1,-0.5,1,1.5]$
wxcontour_plot(20*exp(-x^2-y^2)-10,[x,-2,2],[y,-2,2],[yx_ratio,1],[xlabel,"x[m]"],[ylabel,"y[m]"],
[gnuplot_preamble, "set cntrparam levels 18; set grid; set size ratio -1; set key outside top rmargin"],
[grid,2,100])$
wxdraw2d(polygon(lx,ly))$
答案 0 :(得分:1)
以下是使用gnuplot_preamble
:
lx:[-0.5,1.5,2,-1.5]$
ly:[-1,-0.5,1,1.5]$
wxcontour_plot(20*exp(-x^2-y^2)-10,[x,-2,2],[y,-2,2],[yx_ratio,1],[xlabel,"x[m]"],[ylabel,"y[m]"],
[gnuplot_preamble, "set cntrparam levels 18; set grid; set size ratio -1;
set key outside top;
set object 1 polygon from -0.5,-1. to 1.5,-0.5 to 2.,1. to -1.5,1.5 to -0.5,-1. fs solid fc rgb 'red';"],
[grid,2,100])$
如果您希望多边形不透明,请将front
添加到多边形定义中。