Changing X and Y axis limits??
7 views (last 30 days)
Show older comments
CODE:
function x = logmap(R, timesteps, xinit, color)
clc
x = zeros(timesteps,1);
x(1) = xinit;
for t = 1:length(x)-1
x(t+1) = R*x(t)*(1-x(t));
end
plot(x, [color,'.-'])
xlabel('time')
ylabel('population')
and query the code with
logmap(3.25,50,0.3,'b')
I get a figure with values 0-50 on the X-axis and 0-1 on the Y-axis. But what I am trying to do is init value of 0.3 on the scale of 100 (i.e) the Y-axis scale should be 0-100 such that the init plot is 0.3 * 100 = 30.
I tried to change the limits using 'Plot tools' which basically changed the whole graph. And also I have tried using 'axis' which does not seem to work here.
I tried both the approaches like I mentioned in my question. Not sure they work the way I want them to. The problem is with mapping init value of 0.3 with Y-axis value 30 on X-axis timestep 1. Thanks.
1 Comment
Jan
on 28 Jan 2013
I do not understand "init value of 0.3 on the scale of 100 (i.e) the Y-axis scale should be 0-100 such that the init plot is 0.3 * 100 = 30." Please explain this again.
Answers (1)
See Also
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!