From: Niall Heavey on
Hi all,

I am currently creating a line chart from a m-file, it is going to be usable for a lot of different data so it needs to be quite robust.

The problem i'm having is as follows, I have one hours data and I am plotting it in terms of 5 minute intervals, This means that the x axis is split into sections as follows, 0-5, 5-10, 10-15, 15-20, 20-25, 25-30, 30-35, 35-40, 40-45, 45-50, 50-55, 55-60.

I have set this up manually in the "edit axis ticks" section where the list above were the labels and the locations were the center points of these label values, such as 2.5, 7.5, 12.5, 17.5 and so on.

What i'm trying to do (if possible) is either get the source code for what I have already done so I can copy it into my m-file to reuse, or find out how to do it in code so I can use it in my m-file.

Any one got any ideas?

Thanks,

N
From: someone on
"Niall Heavey" <REMOVEniallALLheaveyCAPLOCKS(a)gmail.com> wrote in message <i21pad$khs$1(a)fred.mathworks.com>...
> Hi all,
>
> I am currently creating a line chart from a m-file, it is going to be usable for a lot of different data so it needs to be quite robust.
>
> The problem i'm having is as follows, I have one hours data and I am plotting it in terms of 5 minute intervals, This means that the x axis is split into sections as follows, 0-5, 5-10, 10-15, 15-20, 20-25, 25-30, 30-35, 35-40, 40-45, 45-50, 50-55, 55-60.
>
> I have set this up manually in the "edit axis ticks" section where the list above were the labels and the locations were the center points of these label values, such as 2.5, 7.5, 12.5, 17.5 and so on.
>
> What i'm trying to do (if possible) is either get the source code for what I have already done so I can copy it into my m-file to reuse, or find out how to do it in code so I can use it in my m-file.
>
> Any one got any ideas?
>
> Thanks,
>
> N

Look at the 'XTick" and 'XTickLabel' properties of the axes command.
Maybe that will get you started.
From: Niall Heavey on
"someone" <someone(a)somewhere.net> wrote in message <i21u58$38q$1(a)fred.mathworks.com>...
> "Niall Heavey" <REMOVEniallALLheaveyCAPLOCKS(a)gmail.com> wrote in message <i21pad$khs$1(a)fred.mathworks.com>...
> > Hi all,
> >
> > I am currently creating a line chart from a m-file, it is going to be usable for a lot of different data so it needs to be quite robust.
> >
> > The problem i'm having is as follows, I have one hours data and I am plotting it in terms of 5 minute intervals, This means that the x axis is split into sections as follows, 0-5, 5-10, 10-15, 15-20, 20-25, 25-30, 30-35, 35-40, 40-45, 45-50, 50-55, 55-60.
> >
> > I have set this up manually in the "edit axis ticks" section where the list above were the labels and the locations were the center points of these label values, such as 2.5, 7.5, 12.5, 17.5 and so on.
> >
> > What i'm trying to do (if possible) is either get the source code for what I have already done so I can copy it into my m-file to reuse, or find out how to do it in code so I can use it in my m-file.
> >
> > Any one got any ideas?
> >
> > Thanks,
> >
> > N
>
> Look at the 'XTick" and 'XTickLabel' properties of the axes command.
> Maybe that will get you started.



Thanks very much.
Thats working grand now.

Just for anyone who might be reading this that has a similar problem I used the following code:

axes(...
'XTick',[2.5 7.5 12.5 17.5 22.5 27.5 32.5 37.5 42.5 47.5 52.5 57.5],...
'XTickLabel',{'0-5','5-10','10-15','15-20','20-25','25-30','30-35','35-40','40-45','45-50','50-55','55-60'})

Thanks for your help!
From: Sergey Holmogorov on
"Niall Heavey" <REMOVEniallALLheaveyCAPLOCKS(a)gmail.com> wrote in message <i21ouc$poh$1(a)fred.mathworks.com>...
> Hi all,
>
> I am currently creating a line chart from a m-file, it is going to be usable for a lot of different data so it needs to be quite robust.
>
> The problem i'm having is as follows, I have one hours data and I am plotting it in terms of 5 minute intervals, This means that the x axis is split into sections as follows, 0-5, 5-10, 10-15, 15-20, 20-25, 25-30, 30-35, 35-40, 40-45, 45-50, 50-55, 55-60.
>
> I have set this up manually in the "edit axis ticks" section where the list above were the labels and the locations were the center points of these label values, such as 2.5, 7.5, 12.5, 17.5 and so on.
>
> What i'm trying to do (if possible) is either get the source code for what I have already done so I can copy it into my m-file to reuse, or find out how to do it in code so I can use it in my m-file.
>
> Any one got any ideas?
>
> Thanks,
>
> N

Hi, you should create two vectors during the plot. One of them vector with x-axis terms, another y-axis terms. Then use plot(x,y) and work will be done.
 | 
Pages: 1
Prev: Axis Properties
Next: textscan()