It appears to me that Automatic
is not a valid input at that level of the option specification. Consider that this generates the same output:
Plot[1 - x^2, {x, -1.5, 1.5}
, Filling -> Axis
, FillingStyle -> {None, "bad input"}
]
Spelunking
I was not able to find any great revelations, but since Alan wrote: "But I'm hoping Mr. Wizard will still offer some insights as to why we would be driven to such hackishness" I thought I should at least try to look at the implementation behind this behavior. I used PrintDefinitions
from the GeneralUtilities packagePrintDefinitions
from the GeneralUtilities package and Trace
. From:
Needs["GeneralUtilities`"]
PrintDefinitions @ System`ProtoPlotDump`iPlot
I found that (in version 10.1.0) the FillingStyle
option value is handed off (as fillingstyle
) to the internal function Charting`customFillingStyle
with the call:
If[filling === None, None,
Charting`customFillingStyle[filling, plotstyle, defaultstyle, fillingstyle,
System`ProtoPlotDump`$FillingStyleOpacity][Length[modelData["Expressions"]],
Plot]]
Spelunking that (PrintDefinitions @ Charting`customFillingStyle
) reveals definitions for explicit Automatic
arguments which would not match {None, Automatic}
, e.g.:
Charting`customFillingStyle[Automatic | Axis, Charting`CommonDump`pstyle_,
Charting`CommonDump`dpstyle_, Automatic, Charting`CommonDump`opacity_] := . . .
Other values are again handed off, this time to as the second parameter of Charting`CommonDump`combinePnFStyle
. Reading that definition (PrintDefinitions @ Charting`CommonDump`combinePnFStyle
) shows that this function is expecting a color (_?ColorQ
) or Graphics directive (_?Charting`generalDirective
), or a List
which contains either colors, directives, or None, e.g. {_?(MatchQ[#1, Except[_Rule, _?ColorQ | None]] &) ..}
. There is no provision for Automatic
at this level of the program. If the argument does not match one of the patterns above is effectively dropped by the final definition in which the second parameter is unnamed and unused:
Charting`CommonDump`combinePnFStyle[_, _, opacity_, i_] :=
Charting`padList[
Charting`ConstructDirective[ColorData[1][i],
If[opacity === {}, {}, Opacity[opacity]]], 2];
What I first wrote is borne out: Automatic
is not a valid input as the element of a List
within the option value of FillingStyle
; it is only valid as the complete option value. I cannot explain this design choice, only offer this analysis of the existing program code. Using FillingStyle -> {None, Opacity[0.2]}
may seem like a hack but it is concise and effective.