Search code examples
backgroundwolfram-mathematicaplotcustomization

Customsize Background in Plot within Mathematica


Considering:

ListPlot[Range[10], 
         Background -> Gray, 
         PlotLabel -> "I don`t want the background here !"]

enter image description here

Is there any way to have the background applied solely to the actual plotting zone?

Not on the axis, not behind the label. So basically to the rectangle {{0,0},{10,10}} in that case?

EDIT: Can we do the Same using PolarListPlot?

Using Sjoerd Solution on From Cartesian Plot to Polar Histogram using Mathematica:

dalist = {{21, 22}, {26, 13}, {32, 17}, {31, 11}, {30, 9}, 
          {25,12}, {12, 16}, {18, 20}, {13, 23}, {19, 21}, 
          {14, 16}, {14,22}, {18, 22}, {10, 22}, {17, 23}}

ScreenCenter = {20, 15}

ListPolarPlot[{ArcTan[##],EuclideanDistance[##]} & @@@ (# - ScreenCenter & /@ dalist), 
               PolarAxes -> True, PolarGridLines -> Automatic, Joined -> False, 
               PolarTicks -> {"Degrees", Automatic}, 
               BaseStyle -> {FontFamily -> "Arial", FontWeight -> Bold, 
               FontSize -> 12}, PlotStyle -> {Red, PointSize -> 0.02}]

enter image description here


Solution

  • You could do something like this:

    ListPlot[Range[10], PlotLabel -> "I don`t want the background here !",
      Frame -> {True, True, False, False}, AxesOrigin -> {0, 0}, 
     Prolog -> {Gray, Rectangle[Scaled[{0, 0}], Scaled[{1, 1}]]}]
    

    enter image description here