Thread Subject: Display an Image with scaled axes

Subject: Display an Image with scaled axes

From: meni vex

Date: 25 May, 2009 14:55:03

Message: 1 of 5

Hi,

I have a 2D matrix, and I want to display it as an image, for example with the 'image', 'imagesc' commands, but, with my axes. I have another 2 vectors holding the x and y values, and I want to display the 2D matrix as function of them.

How can I do this?

Thanks in advance,
Meni

Subject: Display an Image with scaled axes

From: Sadik

Date: 25 May, 2009 15:29:01

Message: 2 of 5

You can do

imagesc(x,y,yourImage)

but you should be careful with which axis you assign as x because imagesc shows the image as if you are viewing the matrix. The first dimension is on the y axis and the second dimension [the columns] are on the x axis...


"meni vex" <meni_vex@yahoo.com> wrote in message <gvebg7$fba$1@fred.mathworks.com>...
> Hi,
>
> I have a 2D matrix, and I want to display it as an image, for example with the 'image', 'imagesc' commands, but, with my axes. I have another 2 vectors holding the x and y values, and I want to display the 2D matrix as function of them.
>
> How can I do this?
>
> Thanks in advance,
> Meni

Subject: Display an Image with scaled axes

From: meni vex

Date: 26 May, 2009 22:40:21

Message: 3 of 5

Thanks, but I already tried it, and it gave me the same results as imagesc(myImage), except a change of the axis labels...
Also in the Matlab doc. they say that it will only change the axes labels, and indeed that was the only change, I mean I expected the graph to change also (due to new scaling of axes) but nothing...
Am I missing something here? any other suggestion?

"Sadik " <sadik.hava@gmail.com> wrote in message <gvedft$irt$1@fred.mathworks.com>...
> You can do
>
> imagesc(x,y,yourImage)
>
> but you should be careful with which axis you assign as x because imagesc shows the image as if you are viewing the matrix. The first dimension is on the y axis and the second dimension [the columns] are on the x axis...
>
>
> "meni vex" <meni_vex@yahoo.com> wrote in message <gvebg7$fba$1@fred.mathworks.com>...
> > Hi,
> >
> > I have a 2D matrix, and I want to display it as an image, for example with the 'image', 'imagesc' commands, but, with my axes. I have another 2 vectors holding the x and y values, and I want to display the 2D matrix as function of them.
> >
> > How can I do this?
> >
> > Thanks in advance,
> > Meni

Subject: Display an Image with scaled axes

From: Pekka Kumpulainen

Date: 27 May, 2009 07:08:01

Message: 4 of 5

"meni vex" <meni_vex@yahoo.com> wrote in message <gvhr4l$14d$1@fred.mathworks.com>...
> Thanks, but I already tried it, and it gave me the same results as imagesc(myImage), except a change of the axis labels...
> Also in the Matlab doc. they say that it will only change the axes labels, and indeed that was the only change, I mean I expected the graph to change also (due to new scaling of axes) but nothing...
> Am I missing something here? any other suggestion?
>
> "Sadik " <sadik.hava@gmail.com> wrote in message <gvedft$irt$1@fred.mathworks.com>...
> > You can do
> >
> > imagesc(x,y,yourImage)
> >
> > but you should be careful with which axis you assign as x because imagesc shows the image as if you are viewing the matrix. The first dimension is on the y axis and the second dimension [the columns] are on the x axis...
> >
> >
> > "meni vex" <meni_vex@yahoo.com> wrote in message <gvebg7$fba$1@fred.mathworks.com>...
> > > Hi,
> > >
> > > I have a 2D matrix, and I want to display it as an image, for example with the 'image', 'imagesc' commands, but, with my axes. I have another 2 vectors holding the x and y values, and I want to display the 2D matrix as function of them.
> > >
> > > How can I do this?
> > >
> > > Thanks in advance,
> > > Meni

Have you tried surface? That might be what you want..

Subject: Display an Image with scaled axes

From: meni vex

Date: 31 May, 2009 09:36:01

Message: 5 of 5

Working fine! thank you so much Pekka!

"Pekka Kumpulainen" <pekka.nospam.kumpulainen@tut.please.fi> wrote in message <gviosh$7et$1@fred.mathworks.com>...
> "meni vex" <meni_vex@yahoo.com> wrote in message <gvhr4l$14d$1@fred.mathworks.com>...
> > Thanks, but I already tried it, and it gave me the same results as imagesc(myImage), except a change of the axis labels...
> > Also in the Matlab doc. they say that it will only change the axes labels, and indeed that was the only change, I mean I expected the graph to change also (due to new scaling of axes) but nothing...
> > Am I missing something here? any other suggestion?
> >
> > "Sadik " <sadik.hava@gmail.com> wrote in message <gvedft$irt$1@fred.mathworks.com>...
> > > You can do
> > >
> > > imagesc(x,y,yourImage)
> > >
> > > but you should be careful with which axis you assign as x because imagesc shows the image as if you are viewing the matrix. The first dimension is on the y axis and the second dimension [the columns] are on the x axis...
> > >
> > >
> > > "meni vex" <meni_vex@yahoo.com> wrote in message <gvebg7$fba$1@fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I have a 2D matrix, and I want to display it as an image, for example with the 'image', 'imagesc' commands, but, with my axes. I have another 2 vectors holding the x and y values, and I want to display the 2D matrix as function of them.
> > > >
> > > > How can I do this?
> > > >
> > > > Thanks in advance,
> > > > Meni
>
> Have you tried surface? That might be what you want..

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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com