# [SOLVED]Plotting runge kutta 4 stability region

#### dwsmith

##### Well-known member
How can I plot the runge kutta 4 stability region? I know on the i axis the max is $$\pm 2\sqrt{2}$$. The plot makes a heart type shape. I don't know how to plot it though but would like to.

Staff member

#### MarkFL

Staff member
No, I don't have Matlab, and I didn't realize their code was calling an extrinsic function.

#### dwsmith

##### Well-known member
I was able to plot it.

#### MarkFL

Staff member
Beautiful image, Dustin!

Did you write your own contourplot function?

#### dwsmith

##### Well-known member
Beautiful image, Dustin!

Did you write your own contourplot function?
Definitely not:

Code:
[X, Y] = meshgrid(-3:.01:1, -3:.01:3);
Mu = X + i*Y;
R = 1 + Mu + .5*Mu.^2 + (1/6)*Mu.^3 + (1/24)*Mu.^4;
Rhat = abs(R);
Rhat = Rhat.*(Rhat<1);  %# here I truncate
imagesc([min(X(:)) max(X(:))],[min(Y(:)) max(Y(:))], Rhat)
colormap(flipud(bone))

Last edited: