使用方法"/>
MATLAB中legengd的使用方法
matlab的legend用法:普通用法
参考:
.html
针对:需要绘制的图例较多,用一个句子表达起来式子很长,不美观;此外,在绘图的开始,无法提前获知需要画多少个图例。
针对多个图形标注其中几个图形的情况:参看:下面
/
.html
x = -pi:pi/20:pi;
y1 = sin(x);
plot(x,y1)
hold on
y2 = cos(x);
plot(x,y2,’–’)
hold off
legend(‘sin(x)’,‘cos(x)’,‘Location’,‘northwest’,‘Orientation’,‘vertical’)
!matlab默认情况
x = -pi:pi/20:pi;
y1 = sin(x);
plot(x,y1)
hold on
y2 = cos(x);
plot(x,y2,’–’)
hold off
legend(‘sin(x)’,‘cos(x)’,‘Location’,‘northwest’,‘Orientation’,‘horizontal’)
更多推荐
MATLAB中legengd的使用方法
发布评论