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 Center および File ExchangeGraphics Performance についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by