简体   繁体   中英

Highlighting section(s) of surface

I have analytically verified that a local min of x^2+y^2-x*y lies at the point (1,1) on the condition x+y=2 . Using wxMaxima, can plot the surface

plot3d(x^2+y^2-x*y, [x,-2,2],[y,-2,2],[grid, 100,100], [mesh_lines_color,false]);

What I would like to do now is highlight all the points z on the surface that satisfy the condition x+y=2 . In other words, I'd like to highlight the section of the surface given by the condition. How do I achieve this?

Since your question is tagged with gnuplot , here is a way how one could do that in Gnuplot using a parametric plot:

set terminal pngcairo
set output 'fig.png'

unset key

set isosamples 40
set parametric

set ur [-2:2]
set vr [-2:2]
set zr [0:12]

set xr [-2:2]
set yr [-2:2]

fn(u) = 2-u

splot \
    u,v,u**2 + v**2 - u*v, \
    u,fn(u),u**2 + fn(u)**2 - u*fn(u) w l lc rgb 'red'

The output is then: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM