8
$\begingroup$

In Mathematica 12 I can use ListPlot to visualize uncertainty of tabulated data as bands. For example:

ListPlot[
    Table[{i, Around[Sin[i], 0.1 + 0.1 Cos[i]]}, {i, 0, 10, 1.0}],
    PlotStyle -> Directive[Red],
    IntervalMarkers -> "Bands",
    IntervalMarkersStyle -> Directive[Orange, Dashed],
    Joined -> True,
    InterpolationOrder -> 3]

How can I control the filling color separately from the style of band border lines?

For example, I would like to make the dashed lines magenta, while keeping the band orange.

Another example: make dashed lines actually invisible (not just of the same color), but keep semi-transparent orange band. This is useful to visualize overlapping semi-transparent bands.

IntervalMarkersStyle has structured styling options, but they do not seem to work with IntervalMarkers -> "Bands"

$\endgroup$
8
$\begingroup$

For "Bands", you can use FaceForm to style fillings. So, using

IntervalMarkersStyle -> Directive[Magenta,Thick, Dashed, FaceForm[Opacity[.3, Green]]]

we get

enter image description here

Update: To make the edges transparent, you can use

 IntervalMarkersStyle -> Directive["LineOpacity" -> 0, FaceForm[Opacity[.3, Green]]]

enter image description here

Additional undocumented directives that you can combine:

IntervalMarkersStyle -> Directive[
   "LineOpacity" -> .5,
   "LineColor" -> Blue,
   "Thickness" -> .01,
   "Dashing" -> Large,
   "FrontFaceColor" -> Yellow,
   "FrontFaceOpacity" -> .5 ]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks! The undocumented directives provide exactly the customizations I was looking for. $\endgroup$ – Shadowray Jul 25 at 10:38

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.