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:
ezcontour and hold on?

Subject: ezcontour and hold on?

From: Dustin

Date: 18 May, 2011 15:29:04

Message: 1 of 3

I'm using a GMM to track feature degradation. I then want to show the two contour maps on the same figure but i seem to have a problem putting them on the same figure.

I also want to put an arrow between the two, but I will cross that bridge when I get there (unless someone wants to be super helpful).

The output of the two fits (gmdistribution.fit) for the figure is normal_obj and test_obj
ex:

figure; ezcontour(@(x,y)pdf(normal_obj,[x y]))
hold on
ezcontour(@(x,y)pdf(test_obj,[x y]))

Subject: ezcontour and hold on?

From: Florin Neacsu

Date: 18 May, 2011 16:48:03

Message: 2 of 3

"Dustin" wrote in message <ir0ok0$of0$1@newscl01ah.mathworks.com>...
> I'm using a GMM to track feature degradation. I then want to show the two contour maps on the same figure but i seem to have a problem putting them on the same figure.
>
> I also want to put an arrow between the two, but I will cross that bridge when I get there (unless someone wants to be super helpful).
>
> The output of the two fits (gmdistribution.fit) for the figure is normal_obj and test_obj
> ex:
>
> figure; ezcontour(@(x,y)pdf(normal_obj,[x y]))
> hold on
> ezcontour(@(x,y)pdf(test_obj,[x y]))

Hello,

From the doc of ezcontour and a simple example :

>> f=@(x,y) 3*(1-x).^2.*exp(-(x.^2) - (y+1).^2) ...
   - 10*(x/5 - x.^3 - y.^5).*exp(-x.^2-y.^2) ...
   - 1/3*exp(-(x+1).^2 - y.^2);
>> ezcontour(f,[-3,3],49)
>> hold on
>> ezcontour(@(x,y) x.^2+y.^2-2,[-3 3],49)

you get a figure with both plots, so I don't see exactly what you mean. Maybe provide the data and/or errors you get.

Regards,
Florin

Subject: ezcontour and hold on?

From: Dustin

Date: 18 May, 2011 17:37:03

Message: 3 of 3

"Florin Neacsu" wrote in message <ir0t83$auv$1@newscl01ah.mathworks.com>...
> "Dustin" wrote in message <ir0ok0$of0$1@newscl01ah.mathworks.com>...
> > I'm using a GMM to track feature degradation. I then want to show the two contour maps on the same figure but i seem to have a problem putting them on the same figure.
> >
> > I also want to put an arrow between the two, but I will cross that bridge when I get there (unless someone wants to be super helpful).
> >
> > The output of the two fits (gmdistribution.fit) for the figure is normal_obj and test_obj
> > ex:
> >
> > figure; ezcontour(@(x,y)pdf(normal_obj,[x y]))
> > hold on
> > ezcontour(@(x,y)pdf(test_obj,[x y]))
>
> Hello,
>
> From the doc of ezcontour and a simple example :
>
> >> f=@(x,y) 3*(1-x).^2.*exp(-(x.^2) - (y+1).^2) ...
> - 10*(x/5 - x.^3 - y.^5).*exp(-x.^2-y.^2) ...
> - 1/3*exp(-(x+1).^2 - y.^2);
> >> ezcontour(f,[-3,3],49)
> >> hold on
> >> ezcontour(@(x,y) x.^2+y.^2-2,[-3 3],49)
>
> you get a figure with both plots, so I don't see exactly what you mean. Maybe provide the data and/or errors you get.
>
> Regards,
> Florin

That is very strange, the example you provide works but mine does not. I inserted a pause in between my plotting and I can see it is overwriting the first plot with the second. Thanks for the help but I still cannot get a solution. I'm thinking it might have something to do with the fit, but that doesn't make much sense to me.

I don't get any errors, and I will refrain from posting the code because it is rather lengthy and the data set is rather large. Maybe I will try to simplify it some and post back.

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