I was so proud of my crummy workaround for the legend bug not displaying properly on my plot, I had to share it.

1 回表示 (過去 30 日間)
text(n(2), 25,'Temp','Color','red','FontSize',9) %place text, choose good spot
text(n(2), 20,'Humidity --','Color','blue','FontSize',9) %place text
%the text below places a rectangle around the text above, this is a very
%specific location and neither the text nor rectangle will update location
%if different data is entered, legend for some reason is not functioning
%properly and this is a workaround, manually placing a rectangle in the
%figure window -> right click -> show code will allow you to fix this
%location with different data if legend is still not functioning properly
annotation('rectangle',...
[0.177785714285714 0.262698412698413 0.13352380952381 0.0968253968253969]);
I was up last night for days trying to figure why my legend wasn't displaying properly when I finally took matters into my own hands!
Glad I found the opengl('save,'software') command fix because this was a bit of work as you can see by the massive novel I wrote explaining how to get your graph to display with a legend properly.
Any idea why the opengl command was necessary at all? I'm guessing it is a known bug.
  2 件のコメント
Star Strider
Star Strider 2020 年 1 月 9 日
It seems to be a problem with recent AMD graphics drivers.
Waiting for AMD to fix it.
Tony Dimichele
Tony Dimichele 2020 年 1 月 9 日
Ah that makes sense why my old laptop never had this problem.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by