如何在Mathematica中绘制阴影

4 wolfram-mathematica

我想生成如下的情节

在此输入图像描述

即使我可以完成框架,我也不确定如何生成阴影.我想知道在Mathematica中绘制阴影中某些区域的一般方法.请帮忙.谢谢.

Arn*_*ing 8

也许你在找RegionPlot

RegionPlot[(-1 + x)^2 + (-1 + y)^2 < 1 && 
 x^2 + (-1 + y)^2 < 1 && (-1 + x)^2 + y^2 < 1 && x^2 + y^2 < 1, 
 {x, 0, 1}, {y, 0, 1}]
Run Code Online (Sandbox Code Playgroud)

Mathematica图形


Dr.*_*ius 7

注意在下面使用op_(曲线和交点只有组方程式!):

t[op_] :=Reduce[op[(x - #[[1]])^2 + (y - #[[2]])^2, 1], y] & /@ Tuples[{0, 1}, 2]
tx = Texture[Binarize@RandomImage[NormalDistribution[1, .005], 1000 {1, 1}]];

Show[{

  Plot[y /. ToRules /@ #, {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}] &@ t[Equal], 
  RegionPlot[And @@ #, {x, 0, 1}, {y, 0, 1}, PlotStyle -> tx] &@ t[Less]}, 

Frame->True,AspectRatio->1,FrameStyle->Directive[Blue, Thick],FrameTicks->None]
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述


Mar*_*ure 5

如果由于任何特殊原因,您想要在图片中使用虚线效果,您可以这样做:

pts = RandomReal[{0, 1}, {10000, 2}];
pts = Select[pts,
  And @@ Table[Norm[# - p] < 1, {p,
   {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}] &];
Graphics[{Thick,
  Line[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}],
  Circle[{0, 0}, 1, {0, Pi/2}],
  Circle[{1, 0}, 1, {Pi/2, Pi}],
  Circle[{1, 1}, 1, {Pi, 3 Pi/2}],
  Circle[{0, 1}, 1, {3 Pi/2, 2 Pi}],
  PointSize[Small], Point[pts]
}]
Run Code Online (Sandbox Code Playgroud)

Mathematica图形