1
$\begingroup$

I´m analizyng the game "Battle of the Buddies" similar to "Prisioner´s Dilenma"

All works fine, BUT... I want to draw in red the point whose coordinates are less than the coords of a strategy.

Manipulate[

 ParametricPlot[{5* x*y - x - y + 1, 6*x*y - 5 x - 5 y + 5}, {x, 0, 
   1}, {y, 0, 1}, PerformanceGoal -> "Quality",

  Epilog -> {Red, PointSize -> .036, 
    Point[{5* p*q - p - q + 1, 6*p*q - 5 p - 5 q + 5}]}],
 (*ParametricPlot[{5* \
x*y-x-y+1,6*x*y-5x-5y+5},{x,0,1},{y,0,1},PerformanceGoal->"Quality",*)
\


 Style["Representación de los pagos Norm(abscisas) y Cliff(ordenadas) \
en Battle of the Buddies", 11, Bold],
 Delimiter,

 Style["Norm usa la estrategia mixta(p,1-p), con el valor de p \
indicado a continuación", 10, Darker@Blue],
 {{p, 0}, 0, 1, Appearance -> "Open"},
 Delimiter,

 Style["Cliff usa la estrategia mixta (q,1-q), con el valor de q \
indicado a continuación", 10, Darker@Orange],
 {{q, 0}, 0, 1, Appearance -> "Open"},
 Delimiter,

 Style["Valores MAXIMIN", 11, Bold, Darker@Black],
 Style["Valor Maximin para Norm: 5/6", 10, Darker@Gray],
 Style["Valor Maximin para Cliff: 5/6", 10, Darker@Gray],

 Delimiter,
 Style["Estrategias de Equilibrio", 11, Bold, Darker@Black],
 Delimiter,
 Style["Creado por Mika Ike ([email protected])", 10, 
  Darker@Black],

 ControlPlacement -> Left, SaveDefinitions -> True

 ]

I can view this enter image description here

BUT I want to view this.... and I can´t coding that. (Highlighting the set in red) enter image description here

$\endgroup$
2
  • $\begingroup$ Possible duplicate: Mark an 2d-area on a 3dPlot (ListPlot3d) $\endgroup$
    – Mr.Wizard
    Commented Dec 19, 2013 at 15:19
  • $\begingroup$ This is in 2D. And... How can I add 3 ponits more?, in (2,2) , (1,5) and (5,1). If I add Epilog2,.... The word turns in red. $\endgroup$
    – Mika Ike
    Commented Dec 20, 2013 at 7:05

1 Answer 1

4
$\begingroup$

Just for illustrative purposes. You can modify and limit range in parameter space as required.

Manipulate[
 {p, q} = m;
 p1 = ParametricPlot[fun[x, y], {x, 0, 1}, {y, 0, 1}, 
   Epilog -> {{Red, PointSize[0.02], Point[fun[p, q]]}, 
     Text[fun[p, q], {3, 5}]}, PerformanceGoal -> "Quality", 
   ImageSize -> {300, 300}];
 p2 = ParametricPlot[fun[x, y], {x, p, 1}, {y, 0, q}, 
   PlotStyle -> Red, Mesh -> False, PerformanceGoal -> "Quality", 
   ImageSize -> {300, 300}];
 Show[p1, p2],
 {m, {0.1, 0.1}, {0.99, 0.99}}, 
 Initialization :> (fun[x_, y_] := {5*x*y - x - y + 1, 
     6*x*y - 5 x - 5 y + 5})]

enter image description here

EDIT

In light of Mika Ike requestL

Manipulate[{p, q} = m;
 p1 = ParametricPlot[fun[x, y], {x, 0, 1}, {y, 0, 1}, 
   Epilog -> {{Red, PointSize[0.02], Point[fun[p, q]]}, 
     Text[fun[p, q], {3, 5}]}, PerformanceGoal -> "Quality", 
   ImageSize -> {300, 300}];
 p2 = ParametricPlot[fun[x, y], {x, 0, 1}, {y, 0, 1}, 
   PlotStyle -> Red, 
   RegionFunction -> 
    Function[{x, y, u, v}, 
     0 < x < fun[p, q][[1]] && 0 < y < fun[p, q][[2]]], Mesh -> False,
    PerformanceGoal -> "Quality", ImageSize -> {300, 300}];
 Show[p1, p2], {m, {0.1, 0.1}, {0.99, 0.99}}, 
 Initialization :> (fun[x_, y_] := {5*x*y - x - y + 1, 
     6*x*y - 5 x - 5 y + 5})]

yields:

enter image description here

$\endgroup$
1
  • $\begingroup$ Yes, fantastic!!. but I want is perpendicular lines from de red point. (to the axis). $\endgroup$
    – Mika Ike
    Commented Dec 28, 2013 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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