How do I optimize graph size?

4 次查看(过去 30 天)
Byungho
Byungho 2023-11-20
评论: Byungho 2023-11-20
How do I optimize the black graph? I cannot display the red and blue graph because of the scale of the black graph. Is there any ways to shrink the only black graph and so that I can display three graph together properly. I need to use the maxium value of the black graph.
please, help me to make the proper graph.
Thank you.
  1 个评论
Sam Chak
Sam Chak 2023-11-20
Tfuel obviously has a larger amplitude compared to Twater and Tclad. Do you want to normalize them and plot all normalized sine waves on the same graph?
Also, what exactly do you mean by "I need to use the maximum value of the black graph"?

请先登录,再进行评论。

采纳的回答

VBBV
VBBV 2023-11-20
May be the change in coefficient for cosine function plotted in black color as shown below
z = -72:0.2:72;
hold on
Tb = 543.41+41.9*(1+sin(pi*z/144));
plot(z,Tb,'r','linewidth',2)
Tb = 543.41+41.9*(1+sin(pi*z/144))+48.86*(cos(pi*z/144));
plot(z,Tb,'b','linewidth',2)
Tb = 543.41+41.9*(1+sin(pi*z/144))+33.72*(cos(pi*z/144)); % may be this change
plot(z,Tb,'k','linewidth',2); grid; legend('Twater','Tclad','Tfuel','location','best')
  2 个评论
VBBV
VBBV 2023-11-20
if you want all the plots to compare together, an alternate way is to use subplot
z = -72:0.2:72;
subplot(211)
Tb = 543.41+41.9*(1+sin(pi*z/144));
plot(z,Tb,'r','linewidth',2); grid;
Tb = 543.41+41.9*(1+sin(pi*z/144))+48.86*(cos(pi*z/144));
hold on
plot(z,Tb,'b','linewidth',2)
Tb = 543.41+41.9*(1+sin(pi*z/144))+3372*(cos(pi*z/144)); % may be this change
legend('Twater','Tclad','location','best')
subplot(212)
plot(z,Tb,'k','linewidth',2); grid; legend('Tfuel','location','best')
Byungho
Byungho 2023-11-20
Thanks, It works great.

请先登录,再进行评论。

更多回答(1 个)

Mathieu NOE
Mathieu NOE 2023-11-20
hello
first idea would be to use a Y log scale so it would reduce the black curve peak and you would see better the blue and red curves
z = -72:0.2:72;
Tb = 543.41+41.9*(1+sin(pi*z/144));
Tc = 543.41+41.9*(1+sin(pi*z/144))+48.86*(cos(pi*z/144));
Tm = 543.41+41.9*(1+sin(pi*z/144))+3372*(cos(pi*z/144));
plot(z,Tb,'r',z,Tc,'b',z,Tm,'k','linewidth',2);
semilogy(z,Tb,'r',z,Tc,'b',z,Tm,'k','linewidth',2);
legend('Twater','Tclad','Tfuel','location','best')
otherwise you can try also to break the y axis in two separate parts :

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by