Function Repository Resource:

LabelListPlot

Source Notebook

Plot the occurrences of labels in a list

Contributed by: Michael Sollami

ResourceFunction["LabelListPlot"][list]

plots the occurrences of labels in a list.

Details and Options

ResourceFunction["LabelListPlot"] accepts the options of ListPlot.
ResourceFunction["LabelListPlot"] skips any occurence of Missing in the list.

Examples

Basic Examples (1) 

Make a simple LabelListPlot:

In[1]:=
ResourceFunction["LabelListPlot"]@
 RandomChoice[{"\[ImaginaryI]", "\[Pi]"}, 200]
Out[1]=

Scope (2) 

Plot a sequence from a categorical distribution:

In[2]:=
cd = CategoricalDistribution[{"A", "B", "C", "D"}];
ResourceFunction["LabelListPlot"][RandomVariate[cd, 50], PlotMarkers -> "OpenMarkers"]
Out[3]=

Sublists can be of different lengths:

In[4]:=
input = {Table[RandomChoice[{.2, .8} -> {"a", "b"}], {50}], Table[RandomChoice@{"c", "d"}, {20}]};
Map[If[RandomReal[] > 0.1, #, Missing] &, input, {2}];
In[5]:=
ResourceFunction["LabelListPlot"][input, Joined -> True]
Out[5]=

Publisher

Michael Sollami

Version History

  • 1.0.0 – 01 April 2020

Related Resources

License Information