How can I modify the blurry line of the graph?

15 次查看(过去 30 天)
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