Scaling axes on plot
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am trying to make plots that are the same as the two plots at the bottom of this page http://www.umich.edu/~elements/5e/02chap/learn-cdp2_solution.html
For the very first plot (black), it has it basically at zero on my plot, but on the website the straight horizontal line is elevated
And I am having a problem with the second graph (green) at the bottom of the page because I don't have that straight line before the exponential decay.
For the third graph (blue), the scaling is not good which is why the line shoots straight up, instead of what the one on the website looks like
X = linspace(0,1,1000);
rA = (-10^-8)/3.*(X <= 0.5) + (-10^-8)./(3+10*(X-0.5)).*(X > 0.5);
f2 = @(x) 1./((-10^-8)./(3+10.*(x-0.5)));
figure
plot(X,-1./rA)
for i = 1:numel(X)
if X(i) <= 0.5
V_PFR(i) = (-1000/(10^-8/3)*-0.5);
else
V_PFR(i) = (-1000/(10^-8/3)*-0.5) + -1000*integral(f2,0.5,X(i));
end
end
figure
plot(V_PFR,-rA)
xlim([0 4.5e11])
xlabel('V_{PFR}')
ylabel('r_{A}')
title('r_{A} vs V_{PFR}')
figure
xlim([0 4.5e11])
plot(V_PFR,X)
xlabel('V_{PFR}')
ylabel('X')
title('Conversion vs. V_{PFR}')
0 件のコメント
採用された回答
Adam
2014 年 9 月 17 日
編集済み: Adam
2014 年 9 月 17 日
The first graph you can simply set:
ylim( [0 8e8] );
For the second graph you can just change the first value of V_PFR to 0 since it has a load of repeated values anyway:
V_PFR(1) = 0;
and plot as before.
The final graph suggests that the first 500 values of your V_PFR array should not be constant though. That appears to be more related to the maths than graph scaling. Solving that problem would also mean the second graph should be correct too without the need for the fudge described above.
Your
if X(i) <= 0.5
V_PFR(i) = (-1000/(10^-8/3)*-0.5);
seems to directly contradict what the 3rd graph on that page suggests, giving a constant value for x < 0.5 rather than the decreasing curve shown. That is not something I can help with though as I'm not at all familiar with the equations and can't afford that amount of time to look at them more deeply.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!