# Sided Exclusions in Plot

Consider

Plot[Floor[x],{x,-5.5,5.5},ExclusionsStyle->{None,Blue}]


At each discontinuity, we get circles indicating the jump. Mathematically, Floor[x]=x at these discontinuities, which concides with the left part of the plot and not the right part. This is often indicated by the lower circle being solid and the upper circle being hollow. Can this check (does the boundary coincide with the left or right part) be performed automatically for each continuity, and manifest in the exclusions? For this example, it would appear something like

DiscretePlot[x,{x,-5,5},PlotRange->{-5.5,5.5},Filling->None,ExtentSize->Full,
ExtentMarkers->{Graphics[{Thickness[.2],Circle[]}],"Point"}]


Effectively, the issue is that ExclusionsStyle doesn't distinguish between left and right sides of the jump (as DiscretePlot does), and it also doesn't allow for computation (as DiscretePlot doesn't).

1. We can post-process Plot output to replace vertical exclusion lines with disks with desired colors:

ClearAll[modifyExclusions]
modifyExclusions[colors_ : {Red, White}, radius_ : 3] :=
ReplaceAll[Line[a : {_, _}] :> {EdgeForm[Gray], Opacity[1],
Riffle[colors, Disk[#, Offset[radius]] & /@ a]}]


Examples:

modifyExclusions[] @
Plot[Floor[x], {x, -5.5, 5.5}, ExclusionsStyle -> {Red, None}]


modifyExclusions[] @
Plot[Floor[x], {x, -5.5, 5.5},
ExclusionsStyle -> {Red, None}, Filling -> Axis]


modifyExclusions[{Green, White}, 5]@
Plot[Ceiling[x] Sin[x]/4, {x, 0, 3 Pi}, ImageSize -> Large,
ExclusionsStyle -> {Red, None}]


modifyExclusions[{Green, White}, 5] @
Plot[Ceiling[x] Sin[x]/4, {x, 0, 3 Pi}, ImageSize -> Large,
ExclusionsStyle -> {Red, None},
Filling -> Axis, FillingStyle -> LightOrange]


2. If we do not use the Filling option, a more convenient alternative is to use an undocumented feature of ExclusionsStyle and specify the option setting as a function:

ClearAll[exclusionsStyle]
exclusionsStyle[colors_ : {Red, White}, radius_ : 5] := {EdgeForm[Gray],
Riffle[colors, Disk[#, Offset[radius]] & /@ First[#]]}&


Examples:

Plot[Floor[x], {x, -5.5, 5.5},
ExclusionsStyle -> {exclusionsStyle[], None} ]


Plot[Ceiling[x] Sin[x]/4, {x, 0, 3 Pi}, ImageSize -> Large,
ExclusionsStyle -> {exclusionsStyle[], None} ]


• Freaking awesome! Both filling=True and the undocumented ExclusionsStyle are a little buggy (second to last example on my system does not render dots, last one doesn't evaluate second function at all, ver 12.1). Not a problem though -- this is still very useful and usable.