3
$\begingroup$

Using Mathematica 11, I want to divide a $1\times 1$ graphic area into 4 areas divided into the following percentages {.025,.075,.225,.675}. I've tried

RegionPlot[
x y <= .025 || x y >= .05 && x y <= .225 || 
x y > .25 && x y <= .675 || x y > .74, {x, 0, 1}, {y, 0, 1}, 
Mesh -> Full, ImageSize -> Small]

Graphics[{Red, Rectangle[{0, 0}, {.025, .025}], Blue, 
Rectangle[{.025, .025}, {.075, .075}], Green, 
Rectangle[{.075, .075}, {.225, .225}], Orange, 
Rectangle[{.225, .225}, {.675, .675}]}, 
PlotRange -> {{0, 1}, {0, 1}}, Frame -> True]

\[ScriptCapitalR] = 
ImplicitRegion[
x y == .025 || x y == .075 || x y == .225 || x y == .675, {x, y}];
RegionPlot[\[ScriptCapitalR], PlotRange -> {{0, 1}, {0, 1}}, 
GridLines -> Automatic]

Obviously, I don't know how to do this. Any help would be appreciated.

$\endgroup$
  • $\begingroup$ Obviously there are many ways to divide a unit square into 4 regions (unit-width rectangles come to mind). Which one are you looking for ? $\endgroup$ – A.G. Sep 29 '16 at 2:51
  • $\begingroup$ Thanks, unit-width rectangles would be fine. $\endgroup$ – jcm Sep 29 '16 at 3:04
3
$\begingroup$

A simple answer:

{a, b, c, d} = {.025, .075, .225, .675};
Graphics[{
  Red, Rectangle[{0, 0}, {a, 1}],
  Blue, Rectangle[{a, 0}, {a + b, 1}],
  Green, Rectangle[{a + b, 0}, {a + b + c, 1}],
  Orange, Rectangle[{a + b + c, 0}, {1, 1}]}, 
 PlotRange -> {{0, 1}, {0, 1}}, Frame -> True]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thank you very much. At this point, your answer is just what I am looking for, though I would love to understand other ways to compare the areas perhaps using Graphs or Inequalities. But I'm happy to start here. Thank you again. $\endgroup$ – jcm Sep 29 '16 at 3:11

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.