Why is the alignment on my legend wrong? (2016b)

Whenever I try to put a legend on a plot the text ends misaligned with the line information. For instance running the code:
x = [0:.1:2]
figure
plot(x,sin(x),'b')
hold on
plot(x,cos(x),'r')
legend('sin','cos')
Produces the plot:

2 commentaires

I am not able to reproduce this on R2016b for Mac.
I am not able to reproduce this on R2016b for Windows 10, operating in a Virtual Machine.

Réponses (1)

Walter
Walter le 25 Juil 2018
Modifié(e) : Walter Roberson le 25 Juil 2018
I can replicate this in windows 10 R2018a.
figure(1)
for day=1:length(DOI)-1
plot(algN{day, 1}(:,3),'LineWidth',4,'Color','b')
hold on
plot(algN{day, 2}(:,3),'LineWidth',4,'Color','r')
end
hold off
xlabel('ROI')
ylabel('Spatial*Temporal corraltion')
title('Quality of alignmen')
set(gca,'FontSize',20)

2 commentaires

Sean Rice
Sean Rice le 25 Juil 2018
Any idea why that is happening or how to fix it? Also, I don't see a legend command in the code you posted.
Yenju Feng
Yenju Feng le 13 Août 2020
I also have the same problem with 2017a

Cette question est clôturée.

Produits

Version

R2016b

Question posée :

le 18 Juil 2018

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by