Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Here is another method that uses the more general gradient background construction I posted as an answer to "How can I set different opacity values for the background of a ListPlot""How can I set different opacity values for the background of a ListPlot".

This answer is rather late, but I thought it's a good example of how else to use the simple option Prolog -> gradientBackground to create a gradient background:

gradientBackground = 
  With[{bottomColor = Black, topColor = Lighter[Blue]}, 
   Inset[Show[
     Rasterize[
      Graphics[
       Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, 
        VertexColors -> {bottomColor, bottomColor, topColor, 
          topColor}], PlotRangePadding -> 0, ImagePadding -> 0], 
      "Image"], AspectRatio -> Full], {Left, Bottom}, {0, 0}, 
    ImageScaled[{1, 1}]]];


bankerData = 
  Transpose[{Range[100], Accumulate[RandomReal[{-1, 1}, 100]] + 10}];

ListLinePlot[
 bankerData,
 Prolog -> gradientBackground,
 PlotRangePadding -> None,
 Frame -> True,
 Axes -> False,
 GridLines -> Automatic,
 PlotStyle -> White,
 FrameLabel -> {"x", "y"},
 Method -> {"GridLinesInFront" -> True},
 PlotRegion -> {{.04, .96}, {.04, .96}},
 Background -> Black,
 Filling -> Top,
 FillingStyle -> Black,
 PlotRange -> All,
 BaseStyle -> {White, FontFamily -> "Arial"}]

banker plot

Here is another method that uses the more general gradient background construction I posted as an answer to "How can I set different opacity values for the background of a ListPlot".

This answer is rather late, but I thought it's a good example of how else to use the simple option Prolog -> gradientBackground to create a gradient background:

gradientBackground = 
  With[{bottomColor = Black, topColor = Lighter[Blue]}, 
   Inset[Show[
     Rasterize[
      Graphics[
       Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, 
        VertexColors -> {bottomColor, bottomColor, topColor, 
          topColor}], PlotRangePadding -> 0, ImagePadding -> 0], 
      "Image"], AspectRatio -> Full], {Left, Bottom}, {0, 0}, 
    ImageScaled[{1, 1}]]];


bankerData = 
  Transpose[{Range[100], Accumulate[RandomReal[{-1, 1}, 100]] + 10}];

ListLinePlot[
 bankerData,
 Prolog -> gradientBackground,
 PlotRangePadding -> None,
 Frame -> True,
 Axes -> False,
 GridLines -> Automatic,
 PlotStyle -> White,
 FrameLabel -> {"x", "y"},
 Method -> {"GridLinesInFront" -> True},
 PlotRegion -> {{.04, .96}, {.04, .96}},
 Background -> Black,
 Filling -> Top,
 FillingStyle -> Black,
 PlotRange -> All,
 BaseStyle -> {White, FontFamily -> "Arial"}]

banker plot

Here is another method that uses the more general gradient background construction I posted as an answer to "How can I set different opacity values for the background of a ListPlot".

This answer is rather late, but I thought it's a good example of how else to use the simple option Prolog -> gradientBackground to create a gradient background:

gradientBackground = 
  With[{bottomColor = Black, topColor = Lighter[Blue]}, 
   Inset[Show[
     Rasterize[
      Graphics[
       Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, 
        VertexColors -> {bottomColor, bottomColor, topColor, 
          topColor}], PlotRangePadding -> 0, ImagePadding -> 0], 
      "Image"], AspectRatio -> Full], {Left, Bottom}, {0, 0}, 
    ImageScaled[{1, 1}]]];


bankerData = 
  Transpose[{Range[100], Accumulate[RandomReal[{-1, 1}, 100]] + 10}];

ListLinePlot[
 bankerData,
 Prolog -> gradientBackground,
 PlotRangePadding -> None,
 Frame -> True,
 Axes -> False,
 GridLines -> Automatic,
 PlotStyle -> White,
 FrameLabel -> {"x", "y"},
 Method -> {"GridLinesInFront" -> True},
 PlotRegion -> {{.04, .96}, {.04, .96}},
 Background -> Black,
 Filling -> Top,
 FillingStyle -> Black,
 PlotRange -> All,
 BaseStyle -> {White, FontFamily -> "Arial"}]

banker plot

Source Link
Jens
  • 97.9k
  • 7
  • 215
  • 510

Here is another method that uses the more general gradient background construction I posted as an answer to "How can I set different opacity values for the background of a ListPlot".

This answer is rather late, but I thought it's a good example of how else to use the simple option Prolog -> gradientBackground to create a gradient background:

gradientBackground = 
  With[{bottomColor = Black, topColor = Lighter[Blue]}, 
   Inset[Show[
     Rasterize[
      Graphics[
       Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, 
        VertexColors -> {bottomColor, bottomColor, topColor, 
          topColor}], PlotRangePadding -> 0, ImagePadding -> 0], 
      "Image"], AspectRatio -> Full], {Left, Bottom}, {0, 0}, 
    ImageScaled[{1, 1}]]];


bankerData = 
  Transpose[{Range[100], Accumulate[RandomReal[{-1, 1}, 100]] + 10}];

ListLinePlot[
 bankerData,
 Prolog -> gradientBackground,
 PlotRangePadding -> None,
 Frame -> True,
 Axes -> False,
 GridLines -> Automatic,
 PlotStyle -> White,
 FrameLabel -> {"x", "y"},
 Method -> {"GridLinesInFront" -> True},
 PlotRegion -> {{.04, .96}, {.04, .96}},
 Background -> Black,
 Filling -> Top,
 FillingStyle -> Black,
 PlotRange -> All,
 BaseStyle -> {White, FontFamily -> "Arial"}]

banker plot