MATLAB Answers

3D plot including different colors

17 views (last 30 days)
Locks
Locks on 15 Nov 2014
Commented: Star Strider on 23 Nov 2014
Hi,
I'd like to create a 3-D Chart and be able to manipulate the axis in order to see the Dates. the code I completed so far is the following:
myDates=[735845;735846;735847;735850;735851;735852;735853;735854]
stock1=[100;98;102;110;108;122;140;145]
stock2=stock1.*1.1;
stock3=stock2.*1.2;
myStocks=[stock1 stock2 stock3];
myData=[myDates stock1 stock2 stock3]
surf(myStocks)
What I am doing is plotting 3 different stock Price paths and I would like to add the corresponding date on the x-axis and in Addition, be able to rotate the Chart, so that the first line of the plane is stock1, then stock2 and one in the back is stock3. I would also like to have the first value of stock1 on the left side and the last value on the right side so the curve is upward sloping from left to right in this case and also from front to back.
thanks a lot for your supprt.

  0 Comments

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 16 Nov 2014
Locks, meet ribbon:
myDates=[735845;735846;735847;735850;735851;735852;735853;735854];
stock1=[100;98;102;110;108;122;140;145];
stock2=stock1.*1.1;
stock3=stock2.*1.2;
stox = [stock1 stock2 stock3];
figure(1)
ribbon(myDates,stox)
datetick('y', 'yyyy-mm-dd')
set(gca, 'FontSize',8)

  23 Comments

Star Strider
Star Strider on 22 Nov 2014
I can’t suggest anything other than perhaps printing it on B0 paper! Otherwise, you may have to sacrifice some detail to print it on A4 or similar.
It may be worthwhile to search Answers for ‘exportfig’, ‘export_fig’, or other spellings, since others have likely encountered similar situations and tweaked its settings to produce detailed plots of acceptable quality.
Locks
Locks on 23 Nov 2014
I tried to make a pdf but it Looks awful. there are some black spots on the graphics, but I will try to find out more about Export_fig.
Thanks a lot for your help!
Star Strider
Star Strider on 23 Nov 2014

My pleasure!

Also, search Kelly Kearney’s answers. She’s dealt with a some of these problems and her posts might yield some clues on how to do what you want.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products