How to put strings on the x axes
Mostrar comentarios más antiguos
Hello,
I want to plot types of methods vs their corresponding numbers. That is, X axes will be string and Y axes will be numbers. Currently, my matrix is cell as below:
neworder =
'N2' [0.1700]
'HC' [0.1700]
'SAGD' [0.1800]
'Steamflood' [0.4500]
'CSS' [0.4500]
'hot Water' [0.4500]
'CO2' [0.5100]
'Polymer' [0.6300]
'ASP' [0.6300]
'Combustion' [0.6500]
I tried to plot string vs. numbers. It didn't work out. Basically, my X axes is the first column and Y axes is the second column.
Thank you,
Respuesta aceptada
Más respuestas (1)
Thomas
el 31 de Mayo de 2012
figure1 = figure;
axes1 = axes('Parent',figure1,'XTickLabel',neworder(:,1));
box(axes1,'on');
hold(axes1,'all');
% Create plot
plot(cell2mat(neworder(:,2)));
or
bar(cell2mat(neworder(:,2)))
1 comentario
Seyhan Emre Gorucu
el 31 de Mayo de 2012
Categorías
Más información sobre Data Exploration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!