Thread Subject: Question to plotting in matlab

Subject: Question to plotting in matlab

From: JULIE

Date: 16 Nov, 2009 09:00:03

Message: 1 of 8

Dear All!

I have a 3-D Plot: plot3(T), with being a 2*2 matrix
and I need to display the Ticks of all axes.


The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.


For the X-Axis I do not want Matlab to display the numbers 1 to 100, increasing at 1.
I want Matlab to display the numbers 1 to 1.1, increasing at .001.
Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale the axis OR to simply display the interval 1 to 1.1. from the existing axis.

For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite the existing Ticks.

How can I do this????? I would be glad to figure this out, even if I have to change each single Tick manually via the Plot editor.

I am glad to hear back from you.
Thanks

Julie

Subject: Question to plotting in matlab

From: Wolfgang Schwanghart

Date: 16 Nov, 2009 10:00:19

Message: 2 of 8

Julie,

why don't you just rescale your data to the desired data limits and then plot it? How will plot3 work with only one input argument being a two by two matrix?

>> plot3(rand(2))
??? Error using ==> plot3
Not enough input arguments.

Best regards, W.


"JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message <hdr4aj$ku8$1@fred.mathworks.com>...
> Dear All!
>
> I have a 3-D Plot: plot3(T), with being a 2*2 matrix
> and I need to display the Ticks of all axes.
>
>
> The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.
>
>
> For the X-Axis I do not want Matlab to display the numbers 1 to 100, increasing at 1.
> I want Matlab to display the numbers 1 to 1.1, increasing at .001.
> Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale the axis OR to simply display the interval 1 to 1.1. from the existing axis.
>
> For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
> I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite the existing Ticks.
>
> How can I do this????? I would be glad to figure this out, even if I have to change each single Tick manually via the Plot editor.
>
> I am glad to hear back from you.
> Thanks
>
> Julie

Subject: Question to plotting in matlab

From: JULIE

Date: 16 Nov, 2009 12:25:04

Message: 3 of 8

"Wolfgang Schwanghart" <schwanghartremove.this@googlemail.com> wrote in message <hdr7rj$hfn$1@fred.mathworks.com>...
> Julie,
>
> why don't you just rescale your data to the desired data limits and then plot it? How will plot3 work with only one input argument being a two by two matrix?
>
> >> plot3(rand(2))
> ??? Error using ==> plot3
> Not enough input arguments.
>
> Best regards, W.
>
>
> "JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message <hdr4aj$ku8$1@fred.mathworks.com>...
> > Dear All!
> >
> > I have a 3-D Plot: plot3(T), with being a 2*2 matrix
> > and I need to display the Ticks of all axes.

Hello!

The matrix I have is a 2*2 matrix, but there are several variations for the two dimensions. Y1, ...,Yn; X1,...,Xp; with X being nested.
I can not use the rescale, as the data is exactly as I want it to be. It is just that I need to change the X and Y Ticks without changing the Data. I had to use X and Y in this format within the program as I am using the variations for X and Y to index several matrices. Do you know how I could overwrite the values for the X and Y Ticks without changing the data?

Thanks

julie
> >
> >
> > The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.
> >
> >
> > For the X-Axis I do not want Matlab to display the numbers 1 to 100, increasing at 1.
> > I want Matlab to display the numbers 1 to 1.1, increasing at .001.
> > Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale the axis OR to simply display the interval 1 to 1.1. from the existing axis.
> >
> > For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
> > I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite the existing Ticks.
> >
> > How can I do this????? I would be glad to figure this out, even if I have to change each single Tick manually via the Plot editor.
> >
> > I am glad to hear back from you.
> > Thanks
> >
> > Julie

Subject: Question to plotting in matlab

From: Wolfgang Schwanghart

Date: 16 Nov, 2009 12:35:04

Message: 4 of 8

Just create some copies of your variables and rescale them. It is far easier than changing tick labels. If you insist on changing tick labels, than look at the help section for axis properties, Xticklabel.

Best regards, W.

"JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message <hdrgb0$mdl$1@fred.mathworks.com>...
> "Wolfgang Schwanghart" <schwanghartremove.this@googlemail.com> wrote in message <hdr7rj$hfn$1@fred.mathworks.com>...
> > Julie,
> >
> > why don't you just rescale your data to the desired data limits and then plot it? How will plot3 work with only one input argument being a two by two matrix?
> >
> > >> plot3(rand(2))
> > ??? Error using ==> plot3
> > Not enough input arguments.
> >
> > Best regards, W.
> >
> >
> > "JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message <hdr4aj$ku8$1@fred.mathworks.com>...
> > > Dear All!
> > >
> > > I have a 3-D Plot: plot3(T), with being a 2*2 matrix
> > > and I need to display the Ticks of all axes.
>
> Hello!
>
> The matrix I have is a 2*2 matrix, but there are several variations for the two dimensions. Y1, ...,Yn; X1,...,Xp; with X being nested.
> I can not use the rescale, as the data is exactly as I want it to be. It is just that I need to change the X and Y Ticks without changing the Data. I had to use X and Y in this format within the program as I am using the variations for X and Y to index several matrices. Do you know how I could overwrite the values for the X and Y Ticks without changing the data?
>
> Thanks
>
> julie
> > >
> > >
> > > The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.
> > >
> > >
> > > For the X-Axis I do not want Matlab to display the numbers 1 to 100, increasing at 1.
> > > I want Matlab to display the numbers 1 to 1.1, increasing at .001.
> > > Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale the axis OR to simply display the interval 1 to 1.1. from the existing axis.
> > >
> > > For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
> > > I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite the existing Ticks.
> > >
> > > How can I do this????? I would be glad to figure this out, even if I have to change each single Tick manually via the Plot editor.
> > >
> > > I am glad to hear back from you.
> > > Thanks
> > >
> > > Julie

Subject: Question to plotting in matlab

From: Steven Lord

Date: 16 Nov, 2009 14:24:33

Message: 5 of 8


"JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message
news:hdr4aj$ku8$1@fred.mathworks.com...
> Dear All!
>
> I have a 3-D Plot: plot3(T), with being a 2*2 matrix
> and I need to display the Ticks of all axes.
>
>
> The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.
>
>
> For the X-Axis I do not want Matlab to display the numbers 1 to 100,
> increasing at 1.
> I want Matlab to display the numbers 1 to 1.1, increasing at .001.
> Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale
> the axis OR to simply display the interval 1 to 1.1. from the existing
> axis.
>
> For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
> I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite
> the existing Ticks.
>
> How can I do this????? I would be glad to figure this out, even if I have
> to change each single Tick manually via the Plot editor.

SET the axes properties XTick, YTick, ZTick, XTickLabel, YTickLabel, and/or
ZTickLabel. Search the documentation for these properties for more
information.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: Question to plotting in matlab

From: JULIE

Date: 18 Nov, 2009 09:25:12

Message: 6 of 8

"Steven Lord" <slord@mathworks.com> wrote in message <hdrn8v$2i6$1@fred.mathworks.com>...
>
> "JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message
> news:hdr4aj$ku8$1@fred.mathworks.com...
> > Dear All!
> >
> > I have a 3-D Plot: plot3(T), with being a 2*2 matrix
> > and I need to display the Ticks of all axes.
> >
> >
> > The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.
> >
> >
> > For the X-Axis I do not want Matlab to display the numbers 1 to 100,
> > increasing at 1.
> > I want Matlab to display the numbers 1 to 1.1, increasing at .001.
> > Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale
> > the axis OR to simply display the interval 1 to 1.1. from the existing
> > axis.
> >
> > For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
> > I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite
> > the existing Ticks.
> >
> > How can I do this????? I would be glad to figure this out, even if I have
> > to change each single Tick manually via the Plot editor.
>
> SET the axes properties XTick, YTick, ZTick, XTickLabel, YTickLabel, and/or
> ZTickLabel. Search the documentation for these properties for more
> information.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

Hello!

What I want to do is not possible via the set Xtick,Ytick and ZTick command:

Example: The Y dimension reaches from 1 to 101, thus the numbers displayed for the YTicks are 1 to 101. I just need this numbers to change to 1 to 1.1. in steps of .001.
I do NOT need to change any content of the matrix. seriously, Just the YTIck display.

If I use the X Tick command to display the values 1 to 1.1. in steps of .001, only the the first value on the Y axis receive YTick, namely the value 1. If I use the Xlim command I just display the first value of the 101 values I have.

I really just need to overwrite the axis labels into 1 to 1.1. in steps of .001.

Is there any possibility to use the rescale command for this?

But, as I said, I do not want to change the content of the matrix in any way.

I am glad to hear back from you

Thanks

Julie

Subject: Question to plotting in matlab

From: JULIE

Date: 18 Nov, 2009 09:29:03

Message: 7 of 8



Hello!

I am not sure how to rescale a 3-D matrix. How do I do this?

At the moment the limits of the Y dimension are given by 1 to 101.
I need to rescale the values of this dimension into limits of 1 and 1.1.
Thus starting with the second value of Y, I have to divide each element by 1000.

The limits of the X dimension are currently given by 1 and 28.
I need to rescale them into limits of 3 and 30. Thus I have to add 2 to every element of X.

Given the 3-D array Right_matrix(x,y,z), how do I do this in Matlab?

I would be really glad for your help.

Thanks

Julie


"Wolfgang Schwanghart" <schwanghartremove.this@googlemail.com> wrote in message <hdrgto$rqv$1@fred.mathworks.com>...
> Just create some copies of your variables and rescale them. It is far easier than changing tick labels. If you insist on changing tick labels, than look at the help section for axis properties, Xticklabel.
>
> Best regards, W.
>
> "JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message <hdrgb0$mdl$1@fred.mathworks.com>...
> > "Wolfgang Schwanghart" <schwanghartremove.this@googlemail.com> wrote in message <hdr7rj$hfn$1@fred.mathworks.com>...
> > > Julie,
> > >
> > > why don't you just rescale your data to the desired data limits and then plot it? How will plot3 work with only one input argument being a two by two matrix?
> > >
> > > >> plot3(rand(2))
> > > ??? Error using ==> plot3
> > > Not enough input arguments.
> > >
> > > Best regards, W.
> > >
> > >
> > > "JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message <hdr4aj$ku8$1@fred.mathworks.com>...
> > > > Dear All!
> > > >
> > > > I have a 3-D Plot: plot3(T), with being a 2*2 matrix
> > > > and I need to display the Ticks of all axes.
> >
> > Hello!
> >
> > The matrix I have is a 2*2 matrix, but there are several variations for the two dimensions. Y1, ...,Yn; X1,...,Xp; with X being nested.
> > I can not use the rescale, as the data is exactly as I want it to be. It is just that I need to change the X and Y Ticks without changing the Data. I had to use X and Y in this format within the program as I am using the variations for X and Y to index several matrices. Do you know how I could overwrite the values for the X and Y Ticks without changing the data?
> >
> > Thanks
> >
> > julie
> > > >
> > > >
> > > > The Y-axis ranges from 1 to 100 and the Z-axis from 1 to 21.
> > > >
> > > >
> > > > For the X-Axis I do not want Matlab to display the numbers 1 to 100, increasing at 1.
> > > > I want Matlab to display the numbers 1 to 1.1, increasing at .001.
> > > > Thus I want to overwrite the existing Y-Ticks. I do NOT want to rescale the axis OR to simply display the interval 1 to 1.1. from the existing axis.
> > > >
> > > > For the Z-Axis I do not want Matlab to display the numbers 1 to 21.
> > > > I want Matlab to display the numbers 3 to 24. AGAIN I want to overwrite the existing Ticks.
> > > >
> > > > How can I do this????? I would be glad to figure this out, even if I have to change each single Tick manually via the Plot editor.
> > > >
> > > > I am glad to hear back from you.
> > > > Thanks
> > > >
> > > > Julie

Subject: Question to plotting in matlab

From: Steven Lord

Date: 18 Nov, 2009 14:42:25

Message: 8 of 8


"JULIE " <julie.kratz.09@ucl.ac.uk> wrote in message
news:he0eho$iqn$1@fred.mathworks.com...
> "Steven Lord" <slord@mathworks.com> wrote in message
> <hdrn8v$2i6$1@fred.mathworks.com>...

*snip*

> Hello!
>
> What I want to do is not possible via the set Xtick,Ytick and ZTick
> command:
>
> Example: The Y dimension reaches from 1 to 101, thus the numbers displayed
> for the YTicks are 1 to 101. I just need this numbers to change to 1 to
> 1.1. in steps of .001.
> I do NOT need to change any content of the matrix. seriously, Just the
> YTIck display.

Okay. Note that XTick, YTick, and ZTick are only three of the six
properties I mentioned. You want to use the other three, the *Label
properties. See the quote from my response below.

>> SET the axes properties XTick, YTick, ZTick, XTickLabel, YTickLabel,
>> and/or
>> ZTickLabel. Search the documentation for these properties for more
>> information.

If you want to change _how many_ ticks are displayed, then you _would_ need
to modify the *Tick properties, but if you just want to change _the labels_
for the ticks changing the *Label properties will be sufficient.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com