Plot (x,y,z) triplets over coordinates (x,y) with color z

前端 未结 2 365
自闭症患者
自闭症患者 2020-12-21 04:49

I\'ve got a list of points (x,y,z) and would like to visualize them as a curve on a plane with points on (x,y) and any of color/intensity/thickness as z. How can this be don

2条回答
  •  -上瘾入骨i
    2020-12-21 05:43

    The solution can be like that

    x = 0:.05:2*pi;
    y = cos(x);
    planez = zeros(size(x));
    z = x;  % This is the color, vary with x in this case, but you can use your vector
    surface([x;x],[y;y],[planez;planez],[z;z],...
            'facecol','no',...
            'edgecol','interp',...
            'linew',2);
    

    The point is that you are painting a surface, where the colors can easily modified. I dont think it can be done with plot

    enter image description here

提交回复
热议问题