Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I use a JPEG as background to Matlab plot ?

2,011 views
Skip to first unread message

Claus

unread,
Nov 11, 2008, 4:21:02 AM11/11/08
to
Dear experts,

can you tell me if I can use an image as background to a Matlab plot? How?

Thanks,

Claus

Rune Allnor

unread,
Nov 11, 2008, 5:03:33 AM11/11/08
to
On 11 Nov, 10:21, "Claus " <il_consigli...@excite.com> wrote:

> can you tell me if I can use an image as background to a Matlab plot? How?

It *can* be done, but it can be very cumbersome, depending
on what you want to do. To demonstrate:

load clown % Stand-in for your JPEG
imagesc(X) % Stand-in for your JPEG
colormap(map) % Specific for the clown example

hold on; % Prepare to plot on top of the image
plot([100 200],[50,150],'g','linewidth',3) % plot a line

Now, try and see what happens if you want to change the
AXIS settings:

axis([1 500 1 1000])

Both the image and the line is still there, but the image
is distorted. It is up to you to implement all the stuff
that is necessary to handle the image, preserve the scales
and so on.

Rune

Steven Lord

unread,
Nov 11, 2008, 8:55:19 AM11/11/08
to

"Claus " <il_cons...@excite.com> wrote in message
news:gfbipu$c3e$1...@fred.mathworks.com...

> Dear experts,
>
> can you tell me if I can use an image as background to a Matlab plot? How?

It depends on what exactly you mean by "background to a MATLAB plot" -- if
you don't need the image on the same axes as the plot, read through this
document on the support website:

http://www.mathworks.com/support/solutions/data/1-19J7T.html

If you do need it on the same axes as the plot, see Rune's message.

--
Steve Lord
sl...@mathworks.com


0 new messages