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:
imrect on an image with subplots

Subject: imrect on an image with subplots

From: Susan

Date: 7 Mar, 2013 13:30:08

Message: 1 of 2

Hi all,

I am loading a .fig file from which I wish to extract information - this file has a 2x1 subplot. I am using imrect to extract this info. However, the cross hairs for the rect only appear if I hover over the subplot(2,1,2) and not subplot(2,1,1). Can I select which plot to look at? My code follows.

Many thanks in advance.

uiopen('G:\.. \File.fig',1);
h = imrect(gca,[]);
api = iptgetapi(h);
position2 = (api.getPosition());
position = uint32(position2);

Subject: imrect on an image with subplots

From: Shaun VanWeelden

Date: 9 Mar, 2013 04:11:06

Message: 2 of 2

"Susan" wrote in message <kha4p0$fbd$1@newscl01ah.mathworks.com>...
> Hi all,
>
> I am loading a .fig file from which I wish to extract information - this file has a 2x1 subplot. I am using imrect to extract this info. However, the cross hairs for the rect only appear if I hover over the subplot(2,1,2) and not subplot(2,1,1). Can I select which plot to look at? My code follows.
>
> Many thanks in advance.
>
> uiopen('G:\.. \File.fig',1);
> h = imrect(gca,[]);
> api = iptgetapi(h);
> position2 = (api.getPosition());
> position = uint32(position2);

Hi Susan,

I am not positive, but I think that all you need to do is make your axes active by calling axes(hPlot2) where hPlot2 is your axes handle for the second subplot? Once again, not sure, but that would be my guess

Tags for 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