0
$\begingroup$

This question already has an answer here:

I like to draw project of ContourPlot3D into "p-q" plane, but is it possible to do it with Mathematica?

Here is my ContourPlot3D:

ContourPlot3D[(a*p^2)/(2*(1 - p^2)) + 
   1/2 - (1 - a)*(q*((1 + 2*q - 2*q^2)/(q^2) + 2*p*(1 - p)/(1 - p^2) ) + 
       1)/(2*(1 + q)) == 0, {p, 0.01, 0.99}, {q, 0.01, 0.99}, {a, 0, 1}, 
   Axes -> True, 
   AxesLabel -> {"p value", "q value", "alpha value"}, 
   PlotLabel -> "Even curve"]

In addition, can we also put the value of alpha in the picture of the projection?

$\endgroup$

marked as duplicate by ybeltukov, dr.blochwave, Community Nov 24 '15 at 21:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    $\begingroup$ See mathematica.stackexchange.com/questions/26228/…. Also, when giving input, please use indenting so as to create a code block. $\endgroup$ – murray Nov 24 '15 at 19:36
  • $\begingroup$ I was about to post an answer, but I'm slightly confused by "can we also put the value of alpha in the picture of the projection?" What exactly do you mean? If you're projecting down to the p-q plane, that's using every alpha value. So do you mean you want to take slices parallel to the p-q plane? Or are you wanting something like this? $\endgroup$ – Chip Hurst Nov 24 '15 at 20:42
  • $\begingroup$ Yes, when we project to p-q plane, we are using all alpha values. I am wondering if we could label a few cases such as alpha=0.1, 0.3, 0.5, 0.7 so on. But first I like to know how to project ContourPlot3D. Thanks you in advance. $\endgroup$ – user35872 Nov 24 '15 at 20:55
  • $\begingroup$ Yes, I looked at mathematica.stackexchange.com/questions/26228/… before I posted this question. I tried to follow the guideline, but somehow it kept having errors. $\endgroup$ – user35872 Nov 24 '15 at 20:58
1
$\begingroup$

I think I understand your question correctly. If not I will delete this answer.

Is this what you want?

ContourPlot[
  Evaluate[a /. 
    Solve[(a*p^2)/(2*(1 - p^2)) + 
      1/2 - (1 - a)*(q*((1 + 2*q - 2*q^2)/(q^2) + 
      2*p*(1 - p)/(1 - p^2)) + 1)/(2*(1 + q)) == 0, a]
  ], 
  {p, 0, 1}, {q, 0, 1}, 
  FrameLabel -> {"p value", "q value"},
  PlotLegends -> Automatic
]

enter image description here

$\endgroup$
  • $\begingroup$ Yes!!!! Thank you very much. $\endgroup$ – user35872 Nov 24 '15 at 21:01

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