Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

use of XTickLabel

Status
Not open for further replies.

hobbit02

Marine/Ocean
Jun 17, 2002
9
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!
 
Replies continue below

Recommended for you

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor