[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: imagesc
From: |
William Krekeler |
Subject: |
RE: imagesc |
Date: |
Thu, 28 Jul 2011 19:07:28 +0000 |
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of pathematica
Sent: Thursday, July 28, 2011 12:44 PM
To: address@hidden
Subject: imagesc
octave 3.23/ubuntu 10.04
I would be grateful if someone could explain how to use imagesc(). If it is
clear to someone who knows how to use it that I do not have the necessary
insight and remedial education is not a practical option in this forum,
please do not be afraid to say so in this forum - I will not be offended!
I was hoping (I might have misunderstood) that it allows scaling of images
so that a suitable sized raster image might be plotted for rendering in a
browser.
Following the instructions in the manual, I have installed xloadimage (into
ubuntu) using the Synaptic Package Manager.
% the following is just a random plot (not important) to illustrate the
point
tx = ty = linspace (0, 3, 31)';
[xx, yy] = meshgrid (tx, ty);
tz = exp(-xx);
mesh (tx, ty, tz);
box("off"); hold("on");
% end of plot
% then, intending to scale by 0.5, I have tried the following (I am
embarrassed to admit I am not sure how to interpret the 'x' given in the
manual):
imagesc(x, 0.5);
% with the hope of printing a scaled png image with eg
print -dpng filename.png
This yields the following error messages
error: `x' undefined near line () column ()
error: evaluating argument list element number 1
error: evaluating argument list element number 1
I apologise if my reading of the function is naive and this looks stupid!
Still, I have no pride and I will not be offended if someone merely lets me
know that I do not have the necessary skills or insight to use the function
:-)
--
View this message in context:
http://octave.1599824.n4.nabble.com/imagesc-tp3701954p3701954.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
Imagesc works great and creates its own scaling if you just give it a matrix as
input. I generally don't try to scale be a specific value though you could
provide limits over the range of which to scale.
% examples
X = rand(100,100).*(2^14); % you can't plot this 14 bit image in 8 bit
image space
figure,imagesc(X); colorbar % but you can plot it scaled
or you could apply limits
figure, imagesc( X, [ 6000 10000 ] ); colorbar; % or limit the range of
presented data to be scaled to 6000 to 10000
% start specific explanations
Note often times the documentation for Matlab found online closely links or
directly matches the Octave functions.
imagesc(x,y,C) displays C as an image and specifies the bounds of the x- and
y-axis with vectors x and y. If x(1) > x(2) or y(1) > y(2), the image is
flipped left-right or up-down, respectively
imagesc(...,clims) normalizes the values in C to the range specified by clims
and displays C as an image. clims is a two-element vector that limits the range
of data values in C. These values map to the full range of values in the
current colormap.
Hope that helps.
Bill Krekeler
- imagesc, pathematica, 2011/07/28
- RE: imagesc,
William Krekeler <=