plot_glu function supports lasagna plots by changing the ‘plottype’ parameter. For more on lasagna plots, see Swihart et al. (2010) “Lasagna Plots: A Saucy Alternative to Spaghetti Plots.”. The lasagna plots in iglu can be single-subject or multi-subject. The single-subject lasagna plot has rows corresponding to each day of measurements with a color grid indicating glucose values.
The highest glucose values are displayed in red, whereas the lowest are displayed in blue. Thus, the numerical glucose values are mapped to color using the gradient from blue to red, which corresponds to the default ‘blue-red’ color scheme. An alternative ‘red-orange’ color scheme can be selected by the user by corresponding modification of the ‘color_scheme’ parameter.
For plots with a single subject, setting the datatype parameter to “single” will display a plot where the rows represent days.
We can additionally sort the values at each time point by setting
lasagnatype = 'timesorted'
To average across days at each time point, we can use
datatype = 'average':
You can also produce plots for multiple subjects, by using data with multiple values for “id”. By default, this will produce an unsorted lasagna plot using up to 14 days worth of data with each subject displayed in separate rows.
This works for all the above options sans datatype = single.
Lasagna plots are also an excellent way to visualize gaps in data. The inter_gap parameter controls the maximum length of time (in minutes) between glucose readings for interpolation to occur between them. See how more gaps appear in the plot below as inter_gap shrinks.
For further customization of lasagna plots, use the
Within plot_lasagna, the “midpoint” parameter specifies the glucose value (in mg/dL) at which the color transitions from blue to red (the default is 105 mg/dL), and the “limit” parameter specifies the range (the default is [50, 500] mg/dL)
plot_lasagna allows for multi-subject lasagna plots with the additional options of sorting the hours by glucose values for each subject, i.e. horizontal sorting, by setting
lasagnatype = 'subjectsorted'.
plot_lasagna also supports changing the maximum number of days to display, as well as the upper and lower target range limits (LLTR and ULTR), midpoint, and minimum and maximum values to display, all of which will affect the colorbar.
plot_lasagna_1subject allows for customization of the more detailed single subject lasagna plots. There is no datatype parameter for
plot_lasagna_1subject, but there are three types of plots available, accessed with the
As with the
lasagna_plot function, changing the LLTR, ULTR, midpoint, and limits parameters will affect the colorbar.