DBSCAN

Theme

fontLabels=Directive[FontFamily->"Libertinus Serif",FontSize->22];
fontTicks=Directive[FontFamily->"Libertinus Serif",FontSize->18];

(* https://mathematica.stackexchange.com/questions/54545/is-it-possible-to-define-a-new-plottheme *)
Begin["System`PlotThemeDump`"];
Themes`ThemeRules;(*preload Theme system*)

resolvePlotTheme["myThemeBasic",def:_String]:=Themes`SetWeight[
Join[
{ImageSize->Large},
{LabelStyle->fontLabels},
{TicksStyle->fontTicks},
{FrameTicksStyle->fontTicks},
(* 102 is the default grey level of Mathematica *)
{AxesStyle->Directive[AbsoluteThickness[0.3],GrayLevel[(102/255)]]}
]
,$ComponentWeight];
resolvePlotTheme["myTheme",def:_String]:=Themes`SetWeight[
Join[
resolvePlotTheme["myThemeBasic",def],
{PlotStyle->Directive[PointSize[0.013],Thick]}
]
,$ComponentWeight];
resolvePlotTheme["myThemeBW",def:_String]:=Themes`SetWeight[
Join[
resolvePlotTheme["myTheme",def],
{PlotStyle->Thread@Directive[{GrayLevel[0.2],GrayLevel[0.8]},Thick,{Automatic,Dashed}]}
]
,$ComponentWeight];
(* Do not adjust point sizes for region plots *)
resolvePlotTheme["myTheme",def:"RegionPlot"]:=Themes`SetWeight[
Join[
resolvePlotTheme["myThemeBasic",def],
{PlotStyle->Automatic}
]
,$ComponentWeight];

End[];

it[var_]:=Style[var,FontSlant->Italic]
bf[var_]:=Style[var,FontWeight->Bold]
bi[var_]:=bf[it[var]]

Data

data={
{1,1},{0,0},{0,2},{0,(2/3)},{0,(4/3)},
{2,1},
{4,0},{4,2},{3,1},{3.5,0.5},{4,2.8}
};
padding=1.9;
plotRange={MinMax[data[[;;,1]]]+{-padding,padding},MinMax[data[[;;,2]]]+{-padding,padding}};

plot=Show[
ListPlot[MapThread[(Callout[#1,Subscript[bi["p"],#2]]&),{data,Range[Length[data]]}],
PlotRange->plotRange,
AspectRatio->Automatic,
GridLines->Automatic,
PlotTheme->"myTheme",
AxesLabel->{it["x"],it["y"]}
],
Graphics[{
Opacity[0.05],
EdgeForm[Thickness[0.002]],
Table[Disk[p,1],{p,data}]
}],
(* Only used for mouse events *)
ListPlot[data,PlotStyle->{Red,PointSize->0.05}]
]

(*Export[FileNameJoin[{NotebookDirectory[],"DBSCAN_Example.svg"}],plot];*)