Remove Vertical Line at the start of the Line Plot

Hello!) I am plotting multiple time series in a chart and all of these series do not start at the start of the x axis..which must be adding vertical lines at the start of each of the line plotted, which run all the way down to the x axis (as is shown on this picture ,http://ifile.it/1zwk43i , no registration required to download). I wonder if there is a way to use the PLOT function which does not add those not-so-great-lookign vertical lines to the plot? Thanks! Dima

5 Comments

is there really no way to remove those vertical lines?
I saw the figure now. What vertical line are you talking about?
At first ifile.it asked me to enable the flash-player, then I got the message, that there is no such file. When trying it the 3rd time, I see a button called "Request a download Ticket". Finally I gave up. Please read: http://www.mathworks.com/matlabcentral/answers/243-how-do-i-post-a-picture-with-my-question and http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
In addition ifile.it tracked me using several Google tools. That's not nice.
sorry to hear you cannot access the picture...here is another link to it:
http://imageshack.us/photo/my-images/594/stockchart.png/

Sign in to comment.

 Accepted Answer

To show the x axis starting at a particular point, use xlim() or axis()

4 Comments

hello))) thanks) but I need the chart to show all price action....as for the vertical lines I mean those line which are drawn perpendicularly to the x axis at the start of each trend line plotted on the chart above...do you think they can be removed>
Okay, those lines are caused by your data. It is because you have two (or more) data points at the beginning, that their x-values change very little or no change, but their y-values jump from one to another (for example, from roughly 0.69 to 0.8 for the first vertical line). You need to check your data.
good to hear you see the difficulty now....yes those trend liens all start with zero up to seem point in the chart and then they are plotted.....can be the solution to start plotting those lines at the points where the non-zero values start start not from row 4 but from row 555?
thanks!
Yes. Num(4:end,2) means the data in the Num array
second column from 4th row to the last row
So you just need to change it to, for example, Num(555:end,2)

Sign in to comment.

More Answers (1)

Although I cannot see the diagrams, I think that vertical lines appear only, if you include a [0,0] in the plotted data. This could be cleared, if you post the relevant part of your code used for plotting.

2 Comments

thanks) the code to run the plot is from this question(http://www.mathworks.com/matlabcentral/answers/16076-plot-stock-chart-and-overlay-remaining-time-series-from-excel-worksheet)
%%
[Num,Txt,Raw]=xlsread('test.xls');
colors = {'r', 'k', 'g'}; %red, black, green
linetypes = {'--', '-'}; %dashed, solid
figure(1);hold on;
candle(Num(4:end,2),Num(4:end,3),Num(4:end,4),Num(4:end,5),'k');
for k=6:23
plot(Num(4:end,1),Num(4:end,k),[colors{Num(1,k)},linetypes{Num(2,k)}],'linewidth',Num(3,k));
end
hopefully those lines can be removed:)
and the chart is here
http://imageshack.us/photo/my-images/594/stockchart.png/

Sign in to comment.

Categories

Tags

Community Treasure Hunt

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

Start Hunting!