You can plot the price time series of all four stocks on the same figure by using the plot
function. Assuming you have the price data for each stock in separate variables (e.g. stock1
, stock2
, stock3
, stock4
), you can use the following code:
main.m277 chars11 lines
This will produce a single figure with four lines, one for each stock's price time series. The legend and axis labels will help to clarify which line corresponds to which stock.
As for whether you can observe the similarity from the plot easily, this will depend on the data itself. If the price time series for the four stocks have similar patterns over time, then it should be easy to observe the similarity from the plot. If the patterns are very different, it may be more difficult to see the similarity. However, having all four lines on the same plot can still be useful for comparing the absolute values of the prices and identifying any outliers or unusual fluctuations.
gistlibby LogSnag