Plotting data on same axis as graph created by matlab function

2 Ansichten (letzte 30 Tage)
Tom  Pearce
Tom Pearce am 9 Apr. 2011
Hi,
Im using the candle matlab function to produce a candlestick chart on stock data. I would also like to plot other analysis data such as moving average, but how do i put it on the same axes? Ive worked out the moving average fine but the matlab function controls the code for producing the graph, and cant seem to find a way of adding other data even though the x-values are the same. Can you help?
Many Thanks Tom

Antworten (2)

Paulo Silva
Paulo Silva am 9 Apr. 2011
%make first chart
hold on
%make second chart
hold on retains the current plot and certain axes properties so that subsequent graphing commands add to the existing graph.

Oleg Komarov
Oleg Komarov am 9 Apr. 2011
Look at the solution I gave at http://www.mathworks.com/matlabcentral/answers/1177-plotting-a-normal-graph-with-a-candlestick-graph
  2 Kommentare
Tom  Pearce
Tom Pearce am 7 Mai 2011
Hey ye this is a very neat solution, however when i try to cut the data series down to say 50 days for plotting I keep getting problems with 'CAT arguments dimensions are not consistent'. I think the problem lies in the fact that the cnadle function plots the weekends for which there is no stock data, so when you add a moving average for the same time period without the weekends the axis will not line up. Do you have a solution for selecting a specific length of data to plot from yahoos spreadsheets?
Oleg Komarov
Oleg Komarov am 7 Mai 2011
Can you please edit your original post adding the formatted code with the error message?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by