How to extract high-quality image from MATLAB for my research article?

6 次查看(过去 30 天)
I have the following code and I want to plot x1 vs t, x2 vs t and x3 vs t in my article. How can I have a very high resolution image. What commands/code should i use for that?
clc
clear all
close all
x1(1) = 1.5;
x2(1) = -0.15;
x3(1) = 0.1;
a = 1.2;
b = 2.92;
c = 6;
t_span = 100;
dt = 0.01;
t = 0:dt:t_span;
for n = 1:length(t)
x1(n+1) = x1(n) + dt * (x2(n));
x2(n+1) = x2(n) + dt * (x3(n));
x3(n+1) = x3(n) + dt * (-c*x1(n) - b*x2(n) - a*x3(n) + x1(n)*x1(n));
end
  2 个评论
Walter Roberson
Walter Roberson 2025-4-5
clc
clear all
close all
x1(1) = 1.5;
x2(1) = -0.15;
x3(1) = 0.1;
a = 1.2;
b = 2.92;
c = 6;
t_span = 100;
dt = 0.01;
t = 0:dt:t_span;
for n = 1:length(t)-1
x1(n+1) = x1(n) + dt * (x2(n));
x2(n+1) = x2(n) + dt * (x3(n));
x3(n+1) = x3(n) + dt * (-c*x1(n) - b*x2(n) - a*x3(n) + x1(n)*x1(n));
end
plot(t, x1, t, x2, t, x3)
legend({'x1', 'x2', 'x3'})

请先登录,再进行评论。

回答(2 个)

Sam Chak
Sam Chak 2025-4-5
Is 600 dpi good enough?
plot(t, x1, t, x2, t, x3)
ax = gca;
exportgraphics(ax, 'myPlot.png', 'Resolution', 600)
Else if you want to use the default width and match the on-screen size more closely, then try this:
sppi = get(groot, "ScreenPixelsPerInch");
exportgraphics(ax, "myPlot.png", "Resolution", sppi)

Thorsten
Thorsten 2025-4-7
Print to a vector format like eps or pdf and you have an arbitrary fine resolution.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by