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

3 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Dana
Dana el 4 de Sept. de 2020
Editada: Dana el 4 de Sept. de 2020
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}')

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by