필터 지우기
필터 지우기

Plot a a matrix by columns but with a different marker for the data at its end

조회 수: 3 (최근 30일)
I am trying to plot a set of data by introducing the following command
plot11=errorbar(matsizered',matsigmasred',materrred','d','MarkerSize',5)
set(gca,'XScale','log');
xlabel('L/l_e')
ylabel('\sigma_{extinction}')
set(plot11, {'MarkerFaceColor'}, get(plot11,'Color'))
Where matsizered,matsigmasred,materrred are 5x6 matrixes. By doing so, I get the following figure
The question is, can I have the 5 points are the right with an X marker while the other points are still represented by a diamond marker? Thank you very much

채택된 답변

Dana
Dana 2020년 9월 4일
편집: Dana 2020년 9월 4일
figure
hold on % we need this so that successive plotting commands don't overwrite the previous ones
% only plot error bars for the first 5 columns of your matrices
plot11=errorbar(matsizered(:,1:5)',matsigmasred(:,1:5)',materrred(:,1:5)','d','MarkerSize',5)
hax = gca; % current axis handle
hax.ColorOrderIndex=1; % re-set color order for current axis
% plot the remaining error bars individually in order to get the right colors
for j = 1:5
errorbar(matsizered(j,6),matsigmasred(j,6),materrred(j,6),'x','MarkerSize',5)
end
set(plot11, {'MarkerFaceColor'}, get(plot11,'Color'))
set(gca,'XScale','log');
xlabel('L/l_e')
ylabel('\sigma_{extinction}')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by