Plot grraph , srink is problem

5 次查看(过去 30 天)
yogeshwari patel
yogeshwari patel 2024-8-25
评论: DGM 2024-9-1
the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,'o',x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248])

回答(1 个)

Torsten
Torsten 2024-8-25
I don't know what you mean by "I want to change the Y axis value so that the box and plot on x -axis does concide".
Maybe like this:
x=-1000:25:975;
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08];
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08];
semilogy(x,u_RDTM,'o',x,u_exact)
  7 个评论
DGM
DGM 2024-9-1
I didn't know this since I run an older version, but (in some versions newer than R2019b) you can do the following to apply some padding on both x and y.
x=-1000:25:975;
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08];
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08];
plot(x,u_RDTM,'o',x,u_exact)
axis padded
I'm not sure where this change was made, but it's been five years, so I assume that this is an option for most people, especially students.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Title 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by