From: Travis on
I have the mapping toolbox, a georeferenced .tif file and data with lat/long and I can't for the life of me figure out how to plot the data onto the image. I have gone through many of the examples in the mapping toolbox, and still no glory. Any help would be greatly appreciated.
From: Andrew Stevens on
"Travis " <sinusoid2(a)hotmail.com> wrote in message <hlhoht$hqo$1(a)fred.mathworks.com>...
> I have the mapping toolbox, a georeferenced .tif file and data with lat/long and I can't for the life of me figure out how to plot the data onto the image. I have gone through many of the examples in the mapping toolbox, and still no glory. Any help would be greatly appreciated.

Travis,

Do you have the .tfw (world file) for your image? If so, you could try this:

im=imread('foo.tif');
r=wolrdfileread('foo.tfw');
[xim,yim]=pixcenters(r,size(im));

figure
imagesc(xim,yim,im);
set(gca,'ydir','normal',...
'da',[1 1 1])

Note that this is plotting the data on a regular axes, not a map axes (which I have found to be cumbersome to deal with).

-Andrew
From: Travis on
"Andrew Stevens" <astevens(a)JUNKusgs.gov> wrote in message <hli2sd$cvm$1(a)fred.mathworks.com>...
> "Travis " <sinusoid2(a)hotmail.com> wrote in message <hlhoht$hqo$1(a)fred.mathworks.com>...
> > I have the mapping toolbox, a georeferenced .tif file and data with lat/long and I can't for the life of me figure out how to plot the data onto the image. I have gone through many of the examples in the mapping toolbox, and still no glory. Any help would be greatly appreciated.
>
> Travis,
>
> Do you have the .tfw (world file) for your image? If so, you could try this:
>
> im=imread('foo.tif');
> r=wolrdfileread('foo.tfw');
> [xim,yim]=pixcenters(r,size(im));
>
> figure
> imagesc(xim,yim,im);
> set(gca,'ydir','normal',...
> 'da',[1 1 1])
>
> Note that this is plotting the data on a regular axes, not a map axes (which I have found to be cumbersome to deal with).
>
> -Andrew

This works well, but when I do a colorbar it default to 0:255 with the map colors, and the data points follor that colorsystem. Is there a way to change this?
From: Travis on
"Travis " <sinusoid2(a)hotmail.com> wrote in message <hlkhg4$qi6$1(a)fred.mathworks.com>...
> "Andrew Stevens" <astevens(a)JUNKusgs.gov> wrote in message <hli2sd$cvm$1(a)fred.mathworks.com>...
> > "Travis " <sinusoid2(a)hotmail.com> wrote in message <hlhoht$hqo$1(a)fred.mathworks.com>...
> > > I have the mapping toolbox, a georeferenced .tif file and data with lat/long and I can't for the life of me figure out how to plot the data onto the image. I have gone through many of the examples in the mapping toolbox, and still no glory. Any help would be greatly appreciated.
> >
> > Travis,
> >
> > Do you have the .tfw (world file) for your image? If so, you could try this:
> >
> > im=imread('foo.tif');
> > r=wolrdfileread('foo.tfw');
> > [xim,yim]=pixcenters(r,size(im));
> >
> > figure
> > imagesc(xim,yim,im);
> > set(gca,'ydir','normal',...
> > 'da',[1 1 1])
> >
> > Note that this is plotting the data on a regular axes, not a map axes (which I have found to be cumbersome to deal with).
> >
> > -Andrew
>
> This works well, but when I do a colorbar it default to 0:255 with the map colors, and the data points follor that colorsystem. Is there a way to change this?

OK, my last message seems vague to me now. What I am trying to do is have the colorbar apply only to the data I plot on the map/image, and not to the map/image itself. That would scale the colorbar properly from the start.
From: Andrew Stevens on
"Travis " <sinusoid2(a)hotmail.com> wrote in message <hlmg0r$gvm$1(a)fred.mathworks.com>...
> "Travis " <sinusoid2(a)hotmail.com> wrote in message <hlkhg4$qi6$1(a)fred.mathworks.com>...
> > "Andrew Stevens" <astevens(a)JUNKusgs.gov> wrote in message <hli2sd$cvm$1(a)fred.mathworks.com>...
> > > "Travis " <sinusoid2(a)hotmail.com> wrote in message <hlhoht$hqo$1(a)fred.mathworks.com>...
> > > > I have the mapping toolbox, a georeferenced .tif file and data with lat/long and I can't for the life of me figure out how to plot the data onto the image. I have gone through many of the examples in the mapping toolbox, and still no glory. Any help would be greatly appreciated.
> > >
> > > Travis,
> > >
> > > Do you have the .tfw (world file) for your image? If so, you could try this:
> > >
> > > im=imread('foo.tif');
> > > r=wolrdfileread('foo.tfw');
> > > [xim,yim]=pixcenters(r,size(im));
> > >
> > > figure
> > > imagesc(xim,yim,im);
> > > set(gca,'ydir','normal',...
> > > 'da',[1 1 1])
> > >
> > > Note that this is plotting the data on a regular axes, not a map axes (which I have found to be cumbersome to deal with).
> > >
> > > -Andrew
> >
> > This works well, but when I do a colorbar it default to 0:255 with the map colors, and the data points follor that colorsystem. Is there a way to change this?
>
> OK, my last message seems vague to me now. What I am trying to do is have the colorbar apply only to the data I plot on the map/image, and not to the map/image itself. That would scale the colorbar properly from the start.

Travis,

One option is to convert the image to RGB. I do this routinely using REAL2RGB, available on the file exchange. Once your image is RGB, the colormap and 'clim' property of the axis no longer applies.

-Andrew