How can I modify the blurry line of the graph?

조회 수: 11 (최근 30일)
지민 이
지민 이 2024년 2월 23일
답변: Maneet Kaur Bagga 2024년 2월 23일
Hello, I have a question about line.
The results of the previously working graph were derived as distinct lines, but when trying to derive them again using the same coding, the lines of the graph changed blurryly.
How can I modify this graph to a distinct line?
<previously working graph>
<present working graph>

답변 (1개)

Maneet Kaur Bagga
Maneet Kaur Bagga 2024년 2월 23일
Hi,
If you're experiencing blurry lines in your graph where they were distinct before, the possible workaround for this could be:
  • To make the lines more distinct, you can increase the line width when plotting:
plot(x, y, 'LineWidth', 2);
  • MATLAB uses different renderers to display graphics. If the lines are blurry, you can try changing the renderer:
set(gcf, 'Renderer', 'painters'); % Other options include 'opengl' and 'zbuffer'
  • When saving the figure, you can specify a higher resolution:
print('output','-dpng','-r300'); % Saves the figure as a PNG with 300 DPI
  • For the best quality, especially when you need to zoom in without losing clarity, save the figure in a vector format:
print('output','-dsvg'); % Saves the figure as an SVG file
You can also check for "Anti-aliasing" option: Although MATLAB typically handles anti-aliasing automatically, but if you suspect this is causing issues, you might need to adjust your system's graphics settings.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by