This Latex package provide a command to create a 3 facets bubble plot using PGF/TikZ.
Note that the CSV file and some of the keys can be generated automaticaly by the bubble_plot Python module.
The following figure display a bubble plot generated with the following Latex code using the following dummy data.
Bubble plot are used, for instance in a Systematic Mapping Study. See Petersen, Kai, et al. "Systematic mapping studies in software engineering." Ease. Vol. 8. 2008 for a presentation of this methodology.
The main command defined by the bubbleplot Latex package is \bubbleplot:
\documentclass{standalone}
\usepackage{bubbleplot}
\definecolor{2017}{rgb}{0.9248648648648647, 0.9751351351351352, 0.947027027027027}
\definecolor{2018}{rgb}{0.5511687604559576, 0.7592733771834118, 0.6429138065401041}
\definecolor{2019}{rgb}{0.1803921568627451, 0.5450980392156862, 0.3411764705882353}
\pgfplotsset{
colormap={yearcolor}{
color=(2017),
color=(2018),
color=(2019),
}
}
\begin{document}
\bubbleplot[%% KEYS
width=7mm,
height=1cm,
xmin=-10,
xmax=8,
ylabel=Snakes,
meta=nbr,
x field=x,
enlarge y limits=0.3,
x index field=ix,
y field=y,
y index field=iy,
year field=years,
year x shift=-1.4cm,
year y shift=3.5cm,
year padding=12,
x left label=Fishes,
x left label shift=3cm,
x right label=Birds,
x right label shift=2cm,
]
{example.csv} %% CSV FILE NAME
{2017, 2018, 2019} %% YEARS
\end{document}YEARSis the ordered sequence of years used in the plot.CSV FILE NAMEis the CSV file generated by the Python module.KEYSare the followingpgfkeyskeys:widthandheightdefine the width and height of the plot.xminandxmaxdefine the smallest and biggest value in the x axis.ylabelis the label of the facet on the y axis.enlarge y limitsis the spacing between bubbles and the horizontal plot limits, default value0.2.x fieldis the labels on the x axis.x index fieldis the x axis index of bubbles.y fieldis the labels on the y axisy.y index fieldis the y axis index of the bubbles.metais the occurrence displayed in each bubble.year fieldis the year related score mapped to colour.year x shiftandyear y shiftallows to shift the year legend on the x axis and y axis.year paddingdefine the padding between each year in the legend, default value12.x left labelandx right labeldefine the facet label on the left and right parts of the x axis.x left label shiftandx right label shiftallows to place the left and right labels relatively to the year legend.
Note that keys without default values must be set by the user, else the package will raise an error.
