Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
imread and logo

Subject: imread and logo

From: Jonathan

Date: 2 Dec, 2010 00:41:05

Message: 1 of 2

Hi,

I am trying to place a GIF image (logo) in a figure. However, when I bring in the image in the color looks nothing like the original logo. Any thoughts how to rectify?

my code is...

cd ('C:\DATA\Diagrams\Logos')
A = imread('test.gif'); %Load image
% image(A) %Display image
% axis equal %Ensure that x and y scales are the same
ns=.1; % logo size
p=get(gca,'position');
pl=[p(1)+p(4)-9.3*ns,p(2)+p(4)-0.05,ns,ns];
ah=axes('position',pl);
image(A);
axis image;
axis off;

Thanks
Jon

Subject: imread and logo

From: Walter Roberson

Date: 2 Dec, 2010 00:54:51

Message: 2 of 2

On 10-12-01 06:41 PM, Jonathan wrote:

> I am trying to place a GIF image (logo) in a figure. However, when I
> bring in the image in the color looks nothing like the original logo.
> Any thoughts how to rectify?
>
> my code is...
>
> cd ('C:\DATA\Diagrams\Logos')
> A = imread('test.gif'); %Load image
> % image(A) %Display image
> % axis equal %Ensure that x and y scales are the same
> ns=.1; % logo size
> p=get(gca,'position');
> pl=[p(1)+p(4)-9.3*ns,p(2)+p(4)-0.05,ns,ns];

Those numbers look pretty "magic" to me. I wouldn't inherently expect them to
be anything close to the natural size of the image.

> ah=axes('position',pl);
> image(A);
> axis image;
> axis off;

I think I would probably go about things by image(A) and axis('image') to
create the axes and position and size it automatically, and _then_ to set()
the Position if I needed to move or resize it.

Tags for this Thread

No tags are associated with this thread.

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.

Contact us