How do I optimize graph size?

5 views (last 30 days)
Byungho
Byungho on 20 Nov 2023
Commented: Byungho on 20 Nov 2023
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 Comment
Sam Chak
Sam Chak on 20 Nov 2023
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"?

Sign in to comment.

Accepted Answer

VBBV
VBBV on 20 Nov 2023
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 Comments
VBBV
VBBV on 20 Nov 2023
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 on 20 Nov 2023
Thanks, It works great.

Sign in to comment.

More Answers (1)

Mathieu NOE
Mathieu NOE on 20 Nov 2023
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 :

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!