How to customise legend?
이전 댓글 표시
This is probably a very stupid question, but how do I fix this?
Like data1 corresponds to the dark blue of -24°C, but I want the diamonds as one colour, aka orange. So my question is,
How do I adjust the legend so that it shows those 10 temperatures, but only one orange diamond?
I have tried this:
legend(temperatures,{'δ data'})
but the array shows complications.
Here is the code, sorry if it's "messy" or confusing.
for i = 1:10
colororder(clrs)
frequency = SE1Ofreq(:,i);
complex = SE1Ocomp(:,i);
scatter(frequency,complex,50,'filled','MarkerEdgeColor','black')
set(gca,'yscale','log')
set(gca,'xscale','log')
hold on
end
title('Master curve SE-1 Original')
ax = gca;
ax.FontSize = 14;
xlabel('\omega (rad/s)')
ylabel('G* (Pa)')
hold on
legend(temperatures)
yyaxis right
ylabel('δ (°)')
for j = 1:10
frequency1 = SE1Ofreq(:,j);
phase1 = SE1Ophas(:,j);
scatter(frequency1,phase1,50,[0.8500 0.3250 0.0980],'d','filled','MarkerEdgeColor','black')
hold on
end
grid on
ylim([0 90])

댓글 수: 3
Scott MacKenzie
2021년 7월 26일
It would help if you posted the code that generates the plot.
Herline van der Spuy
2021년 7월 26일
Scott MacKenzie
2021년 7월 26일
편집: Scott MacKenzie
2021년 7월 26일
I didn't say explicitly, but I meant "code that can be executed"; i.e., if the data are not embedded in the code, then post the data as well.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!