Setting different values to properties in subplots generated by a function in a plot
이전 댓글 표시
Hi all.
I want to set different values to properties(e.g line colour, LW, labels,...) to different subplots generated by a function in a script.
Thank you in advance
댓글 수: 1
Matt Fig
2012년 9월 14일
Do you have a specific question?
"How do I ___?"
답변 (2개)
Wayne King
2012년 9월 14일
0 개 추천
Why can't you use handles or calls to the plot functions to do that?
Kevin Claytor
2012년 9월 14일
Here's some example code using handles;
figure
subplot(1,2,1);
plot(x,y)
subplot(1,2,2)
h1 = plot(x,z)
hold on
h2 = plot(x,w)
get(h1)
set(h1,'color','r')
set(h1,'linewidth',5)
ax1 = subplot(1,2,1)
get(ax1)
get(ax1,'XLabel')
get(get(ax1,'XLabel'))
set(get(ax1,'XLabel'),'String','myXlabel')
Of course this could be simplified if you specify the properties when you do the plotting (although I understand you can't always do this);
figure
subplot(1,2,1)
plot(x,y)
xlabel('myXlabel')
subplot(1,2,2)
plot(x,z,'color','r','Linewidth',5);
hold on
plot(x,w)
카테고리
도움말 센터 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!