Different style of filling in x direction

I have the following curves:

linea = Line[{{0.1, 0}, {0.1, 50}}]; Show[
Plot[{2/Abs[a], 3/Abs[a], 4/Abs[a], 6/Abs[a]}, {a, 0, 1},
Mesh -> {{0.1, 1}}, MeshShading -> {Dashed, Automatic, Dotted},
MeshStyle -> None, Filling -> {1 -> Axis},
PlotStyle -> {Thickness[0.005]},
Ticks -> {{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},
Automatic}, AxesOrigin -> {0, 0},
Epilog -> {Directive[Black, DotDashed], PointSize[.015], linea}]]


I would like to plot filling option with two different styles: for 0 < a < 1 light grey, for a>1 grey. How can I obtain this option? Moreover, how can I grow up the size of dash in DotDashed style of linea? Thank you

• try Dashing[{0, Small, Large, Small}] in place of DotDashed.
– kglr
Mar 14, 2018 at 10:34
• you probably meant "for 0 < a < 0.1 light grey,..."?
– kglr
Mar 14, 2018 at 11:05

colors = ColorData[1, "ColorList"][[{1, 1, 2, 3, 4}]];
linea = Line[{{0.1, 0}, {0.1, 50}}];
Plot[{ConditionalExpression[2/Abs[a], a <= .1],
ConditionalExpression[2/Abs[a], a >= .1], 3/Abs[a], 4/Abs[a], 6/Abs[a]}, {a, 0, 1},
Mesh -> {{0.1, 1}}, MeshShading -> {Dashed, Automatic, Dotted}, MeshStyle -> None,
Filling -> {1 -> {Axis, LightGray}, 2 -> {Axis, LightBlue}},
Ticks -> {{0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1},  Automatic},
AxesOrigin -> {0, 0},
Epilog -> {Directive[Black, Dashing[{0, Small, Large, Small}]], PointSize[.015], linea}]


• Thanks! how can I specify colors in "colors"? Mar 14, 2018 at 11:18
• @GaeP, my pleasure. Thank you for the accept. You can set colors to your choice, e.g., colors = { Red, Red, Green, Blue, Orange}.
– kglr
Mar 14, 2018 at 11:21
• I would like to use the default color...how can i do this? Mar 14, 2018 at 12:02
• @GaeP, for default color in versions 10+ use colors = ColorData[97, "ColorList"][[{1, 1, 2, 3, 4}]];
– kglr
Mar 14, 2018 at 12:06
• @GaeP, looks like it works in version 11. But in version 9 (it seems in version 10 too) FrameStyle option in Framed does not handle dashing and thickness. You might want to post this as a new question.
– kglr
Mar 15, 2018 at 19:53