Legend (working with previous version) does not work in R2018b

Hi everyone!
I am trying to make a figure in Matlab R2018b with 4 different plots and a legend. However, Legend entries are not coherent, as you can see from the LineStyle.
FH1 = figure;
plot(n_values, Shann(1) .* ones(size(n_values,2)),'LineStyle','--', 'LineWidth', 1.5); grid on, hold on
plot(n_values, Pol(1, n_values, 1e-3),'LineStyle','-', 'LineWidth', 2); grid on, hold on
plot(n_values, Pol(1, n_values, 1e-4),'LineStyle','-', 'LineWidth', 2); grid on, hold on
plot(n_values, Pol(1, n_values, 1e-5),'LineStyle','-', 'LineWidth', 2); grid on, hold on
FH1.CurrentAxes.XLabel.String = 'Blocklength';
FH1.CurrentAxes.XLabel.FontSize= 15;
FH1.CurrentAxes.YLabel.String = 'MCR [bit per ch. use]';
FH1.CurrentAxes.YLabel.FontSize= 15;
FH1.CurrentAxes.FontSize = 18;
FH1.CurrentAxes.XLim= [80 1500];
FH1.CurrentAxes.YLim= [0.3 1.05];
LH = legend({'Shannon Capacity: C(\gamma) = log_{2}(1+\gamma)', 'Maximum Coding Rate with \epsilon = 10^{-3}','Maximum Coding Rate with \epsilon = 10^{-4}', 'Maximum Coding Rate with \epsilon = 10^{-5}'});
LH.Location = 'Southeast';
Figure1.jpg
Thanks in advance!

댓글 수: 1

Try to make a MWE so we can run your code without any other dependencies and can reproduce your issue.
In the release notes you can see the behavior of the legend function was changed slightly. It may be the case that this introduced a bug. Have you checked the bug tracker if there was something reported?

댓글을 달려면 로그인하십시오.

답변 (1개)

madhan ravi
madhan ravi 2019년 1월 17일

0 개 추천

I was not able to reprodcue that in 2018b it's better to contact Mathworks Support Team by clicking the Contact Us button on the top right corner of this page.

카테고리

제품

릴리스

R2018b

질문:

2019년 1월 17일

답변:

2019년 1월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by