12
$\begingroup$

How can I make hatching filling of plot

Like this:

hatching filling plot

I use another one plot with shifting to make filled area above:

plot := ListLinePlot[
  Table[{x1[w], x2[w]}, {w, 1.5, 5, .005}],     
  Filling -> Top,
  FillingStyle -> White
  ]

fill := ListLinePlot[
  Table[{x1[w] - 0.01, x2[w] - 0.02}, {w, 1.5, 5, .005}],
  Filling -> Top,
  FillingStyle -> LightGray,
  PlotStyle -> LightGray
  ]

Show[fill, plot]

plot

How can I make hatching filling of fill-plot?

$\endgroup$
19
$\begingroup$

Something like this?

    RegionPlot[y < 1/x && y + 0.3 > 1/(x + 0.3) , {x, 0, 3}, {y, 0, 4}, 
  AxesOrigin -> {0, 0}, Frame -> False, Axes -> Automatic, Mesh -> 20,
   MeshFunctions -> {#1 - #2 &}, BoundaryStyle -> None]~Show~
 Plot[1/x, {x, 0, 3}]

Mathematica graphics

You can add PlotStyle -> Transparent to the RegionPlot if you don't want the blue filling, and xkcdify it

enter image description here

$\endgroup$
  • $\begingroup$ Beware! The anti-xkcdification patrol is here! mathematica.stackexchange.com/a/13359/193 $\endgroup$ – Dr. belisarius Oct 24 '12 at 22:12
  • 1
    $\begingroup$ @belisarius, oh, but it very much fits the context. I'll defend it as if it was Howgartz against any evil wizard $\endgroup$ – Rojo Oct 25 '12 at 1:39
  • 5
    $\begingroup$ You may always sweeten the answer by throwing in some infix notation. $\endgroup$ – Yves Klett Oct 25 '12 at 12:33
  • 1
    $\begingroup$ @shed, if you want to plot the borders of that region, I'd go with ContourPlot[x1[w] == x2[g], {w, 1.5, 5}, {g, 1.5, 5}] $\endgroup$ – Rojo Oct 26 '12 at 13:55
  • 1
    $\begingroup$ @shed you probably should accept this one, or you are still hoping for something different? $\endgroup$ – Rojo Dec 9 '13 at 22:13

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.