6

Consider the following list

PHB = {{0, 0}, {0.0825`, 0.05`}, {0.167`, 0.1`}, {0.2537`, 
    0.15`}, {0.3426`, 0.2`}, {0.4342`, 0.25`}, {0.5287`, 
    0.3`}, {0.6263`, 0.35`}, {0.7277`, 0.4`}, {0.8331`, 
    0.45`}, {0.9437`, 0.5`}, {1.0592`, 0.55`}, {1.1814`, 
    0.6`}, {1.3115`, 0.65`}, {1.4511`, 0.7`}, {1.6027`, 
    0.75`}, {1.7699`, 0.8`}, {1.9581`, 0.85`}, {2, 0.8601`}, {2.25`, 
    0.9144`}, {2.5`, 0.9584`}, {2.75`, 0.9923`}, {3, 1.0123`}, {3.25`,
     1.0343`}, {3.5`, 1.0444`}, {3.75`, 1.0487`}, {4, 
    1.0481`}, {4.25`, 1.0431`}, {4.5`, 1.0354`}, {4.75`, 1.0248`}, {5,
     1.012`}, {5.25`, 0.9974`}, {5.5`, 0.9812`}, {5.75`, 0.9639`}, {6,
     0.9455`}, {6.25`, 0.9255`}, {6.5`, 0.9043`}, {6.75`, 
    0.8813`}, {7, 0.8559`}, {7.25`, 0.827`}, {7.5`, 0.7928`}, {7.75`, 
    0.7491`}, {8, 0.7085`}, {8.25`, 0.5956`}, {8.3464`, 
    0.55`}, {8.4421`, 0.5`}, {8.5386`, 0.45`}, {8.6318`, 
    0.4`}, {8.7225`, 0.35`}, {8.81`, 0.3`}, {8.8974`, 
    0.25`}, {8.9845`, 0.2`}, {9.0657`, 0.15`}, {9.1472`, 
    0.1`}, {9.2274`, 0.05`}, {9.307`, 0}};

How can I fill the area below the graph provide by Listlineplot it with a texture given by the image

enter image description here

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
jarhead
  • 2,065
  • 12
  • 19

2 Answers2

8

This is one way of doing it:

pattern=Import["https://i.stack.imgur.com/l9iL8.jpg"];

Show[
ListLinePlot[PHB,
    PlotStyle->Directive[Red,Thickness[.007]],
    PlotTheme->"Detailed"],
Graphics[{Texture[pattern],FilledCurve[{BezierCurve[PHB]},
    VertexTextureCoordinates->Automatic]}]
]

enter image description here

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
5

You can also use Filling -> Axis in ListLinePlot and post-process the output to add texture to polygons:

pattern = Import["https://i.stack.imgur.com/l9iL8.jpg"];

Using option settings from Vitaliy's answer:

llp = ListLinePlot[PHB,
 PlotStyle -> Directive[Red, Thickness[.007]],
 PlotTheme -> "Detailed", 
 Filling -> Axis];

llp  /. Polygon[a_,b___] :>
  {Opacity[1], Texture[pattern], Polygon[a, VertexTextureCoordinates -> Automatic]}

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896