首页 > 编程知识 正文

matlab定义三维图区域颜色,matlab怎么改变线的颜色

时间:2023-05-05 16:03:00 阅读:15191 作者:1428

如果有许多类型的数据,MATLAB提供的颜色就不够了。 这里有一个MATLAB示例,可以自定义线条颜色并放置不同的图例

clear clc; 关闭全部; x=[1、2、3、4、5、6、7、8、9、10、11、12、13、14、15、16、17、18、19、20、21]; y1=rand (1,21 ); y2=rand (1,21 ); y3=rand (1,21 ); y4=rand (1,21 ); y5=rand (1,21 ); y6=rand (1,21 ); y7=rand (1,21 ); y8=rand (1,21 ); 图形; y=[y1; y2; y3; y4; y5; y6; y7; y8 ); markertype=['h '、' o '、' x '、' d '、' s '、'、' * '、' p']; %标记的形状color=[ 0,0,1 ]; [ 0,1,0 ] [ 1,0,0 ] [ 0,1,1 ] [ 1,0,1,0 ] [ 0,0,0 ] [ 0.6,0.2,1 ]; %线的颜色legendtxt={'A '、' b '、' c '、' d '、' e '、' f '、' g '、' proposed'}; 保持接通; forI=1:8plot(x,y(I, )、' color ',color ) I, )、' Marker ',markertype(i ) I ); end%plot(x,y1,' h ',' Color ',[0 0 1]; %scatter(tshort,marker ) :I ),markertype ) ),' MarkerEdgeColor ',color{i} ); legend(legendtxt,' location ',' EastOutside ' );

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。