SELECT Temp FROM ggsql:airquality
VISUALISE Temp AS x
DRAW histogram
LABEL
title => 'Temperature Distribution',
x => 'Temperature (F)',
y => 'Count'Histogram
statistical
distribution
Distribution of a single numeric variable
Histograms show the distribution of a numeric variable by grouping values into bins and counting occurrences in each bin.
Code
Explanation
VISUALISE Temp AS xspecifies the variable to binDRAW histogramautomatically computes bins and counts- No y mapping is needed - ggsql computes the count automatically
Variations
Custom bin count
Control the number of bins with SETTING bins:
Custom bin width
Set explicit bin width instead of count:
Density instead of count
Use REMAPPING to show density (proportion) instead of count: