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
2020년 1월 9일
It seems to be a problem with recent AMD graphics drivers.
Waiting for AMD to fix it.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!