How to start a plot at specific point
Mostrar comentarios más antiguos
I would like to plot this graph which has two matrices held on, but I want both of them to start at the point (0,100) rather than start at the first point for each matrix. Below is the code that I've used
%%Plot a Graph with equally weighted stocks
figure1= plot(CumRet);
hold on
plot(CumBench)
title ('Equally Weighted Portfolio v Benchmark')
xlabel('Days Held')
ylabel('Portfolio Balance (in $Mn)')
legend ('Portfolio','Benchmark')
3 comentarios
Geoff Hayes
el 16 de Feb. de 2017
Yuri - please describe CumRet and CumBench. Are they matrices with two columns and n rows? Or the opposite? Is there a point (0,100) in either or are you trying to find the closest point to (0,100)? Perhaps attach the data for both (as mat file(s)) to this question.
Yuri Karev
el 16 de Feb. de 2017
Editada: Image Analyst
el 16 de Feb. de 2017
Geoff Hayes
el 21 de Feb. de 2017
Yuri - so of the thirty elements in the 1x30, which one corresponds to day zero and 100 dollars? Or are you trying to modify the above code so that whatever starts with 100 dollars? Please comment on what your above code is attempting to do.
Respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!