3D plot including different colors

조회 수: 6 (최근 30일)
Locks
Locks 2014년 11월 15일
댓글: Star Strider 2014년 11월 23일
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.

채택된 답변

Star Strider
Star Strider 2014년 11월 16일
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
Locks
Locks 2014년 11월 23일
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 2014년 11월 23일

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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series Events에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by