×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

problem with updation in datetick

problem with updation in datetick

problem with updation in datetick

(OP)
I have probelm using dateticks


I plot 399 values of y,z against 399 time values in x

It starts well by begining at first value of x, but as it goes on plotting the the plot gets compressed due to the dates. And I am not able to handle these dates with datetick function.

I wanted to plot only for the values in x and only plot till the values I am plotting. I was trying to aviod the space it was giving at start and end of the plot.

here is the code I use.

function plot_example

x=textread('times.txt');
x=datenum(x);
x=flipud(x);

y=rand(size(x,1),1);
z=rand(size(x,1),1);

a=[];
b=[];
c=[];
figure(2)
hold on

for i = 1:size(x,1)

 a=[a;x(i)];
 b=[b;y(i)];
 c=[c;z(i)];

    plotting(datenum(a),b,'r')
    plotting(datenum(a),c,'b')


end

 
 function plotting(xx,yy,colors)
 
 plot(xx,yy,colors)
 datetick('x',21)
 drawnow

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources