×
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

use of XTickLabel

use of XTickLabel

use of XTickLabel

(OP)
Hello, everybody!
This is my question.
I am working on plots with ticks labels in date format.
I converted the data into Matlab's serial date format (using datenum), and then I converted the serial dates into a 'month/day' format using datestr using:

      set(gca,'XTickLabel',{datestr(fname1(i,n),6)...

(fname1(:,n) contains the serial dates)

The problem is that the ticks in the X axis appear to pop up in an arbitrary position and I need them to be every time a new day starts.
Is there any way to force the ticks to appear in a determined position?
Hope anybody can help.
Thanks!

RE: use of XTickLabel

Hi,
You can change the 'XTick' and 'YTick' properties of the axes. Use data units. For example:
set(gca,'YTick',[0:20:240],'XTick',[0:100:400]);

Joe
BSTEX - Equation viewer for Matlab
http://www.geocities.com/bstex2001

RE: use of XTickLabel

(OP)
thank you Joe3.
I'll give it a try

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