Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Jun 17, 2002
Messages
9
Location
CA
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!
 
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
 
thank you Joe3.
I'll give it a try
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top