[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Marking axes at irregular intervals
From: |
Ivan Sutoris |
Subject: |
Re: Marking axes at irregular intervals |
Date: |
Tue, 9 Jun 2009 09:08:29 +0200 |
On Tue, Jun 9, 2009 at 5:04 AM, strontium90<address@hidden> wrote:
> Hello everyone,
>
> I have two vectors, x in [-1 100] and y in [0 100] that I would like to
> plot y versus x. However, I would like to have the x and y axes marked
> and labeled at the locations of vector components, for example 1, 2, 3,
> 4, 5, 10, 15, 20, ... on the x axis, preferably preserving aspect ratio.
> Function plot systematically divides the axes at equal intervals 20, 40,
> 60, 80 and 100. Discrete functions bar and hist behave similarly. I'm
> unable to come up with a solution with the function axis.
> All tips are greatly appreciated. Thanks!
>
> --Razmig
Hi
assuming you have your data in variables X, Y and desired ticks in
XTICKS, YTICKS (as vectors):
figure
plot(X,Y)
set(gca(), 'xtick', XTICKS)
set(gca(), 'ytick', YTICKS)
Regards
Ivan Sutoris