0
$\begingroup$

I have the following code

ContourPlot[((11 - j*l)/-j^2)^0.5, {l, 0, 10}, {j, 0, 10}]

which generates:

enter image description here

How can I color the outer region of curves instead of inside?

Something like this:

enter image description here

Basically I wanted to show the inside of the volume of the following figure with contour (not outside the volume):

enter image description here

or

enter image description here

Code:

RegionPlot3D[-j^2*y^2 + j*l < 11, {l, 0, 10}, {j, 0, 10}, {y, 0, 1}]
$\endgroup$
  • $\begingroup$ A square root of a negative number? $\endgroup$ – David G. Stork Dec 16 '17 at 1:35
  • $\begingroup$ Your function is imaginary in the white parts. What do you want to plot there? The imaginary part, the argument? $\endgroup$ – halirutan Dec 16 '17 at 1:35
  • $\begingroup$ @DavidG.Stork updated. Thanks $\endgroup$ – Darrin Cope Dec 16 '17 at 2:24
  • $\begingroup$ @halirutan Updated. Thanks $\endgroup$ – Darrin Cope Dec 16 '17 at 2:24
  • $\begingroup$ Change the sign inside the ^0.5 power....Or, for the volume, reverse the inequality. $\endgroup$ – Michael E2 Dec 16 '17 at 2:45
4
$\begingroup$

I know it is very tempting to throw something at Mathematica and enjoy the output. However, if you leave behind all the thinking, you might end up asking questions that really don't make sense.

Your function is real only for the parts that are already plotted. In the white parts, it is complex with only an imaginary part. One possibility is to look at the absolute value of the complex number. Then you get contours on both sides. In the parts that are still white, the function value becomes really large:

Show[
 ContourPlot[Abs[((11 - j*l)/-j^2)^0.5], {l, 0, 10}, {j, 0, 10}, 
  Contours -> 20, MaxRecursion -> 3],
 Plot[11/j, {j, 0, 10}, PlotRange -> {{0, 10}, {0, 10}}, 
  PlotStyle -> {Thick, Yellow}]
 ]

Mathematica graphics

Edit

Thanks a lot for your comment. I did not release enough details, you are right. I basically wanted to draw the contour of the figure (added to the question) but the inside of the volume not outside. I hope it clears up.

Look, I already explained in detail, why the inside part is plotted and the outside part not. If the inside part is plotted because it is real and the outside part not because it is imaginary, what can you do to turn this around?

Now you will say, yes, the answer was obvious and bang you get

Mathematica graphics

Show[ContourPlot[((11 - j*l)/-j^2)^0.5*(-I), {l, 0, 10}, {j, 0, 10},Contours -> 20, MaxRecursion -> 3],Plot[11/j, {j, 0, 10}, PlotRange -> {{0, 10}, {0, 10}},PlotStyle -> {Thick, Yellow}]]

$\endgroup$
  • $\begingroup$ Thanks a lot for your comment. I did not release enough details, you are right. I basically wanted to draw the contour of the figure (added to the question) but the inside of the volume not outside. I hope it clears up. $\endgroup$ – Darrin Cope Dec 16 '17 at 2:21
  • $\begingroup$ Thanks! How can I obtain the contour that I want then? I am basically trying to show the inside of volume is acceptable area in 2D (for different z values) $\endgroup$ – Darrin Cope Dec 20 '17 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.