Plot

Warning

Plotting functionality is in early stages and is experimental. Interfaces will change regularly.

Plotting in Hail is easy. Hail’s plot functions utilize Bokeh plotting libraries to create attractive, interactive figures. Plotting functions in this module return a Bokeh Figure, so you can call a method to plot your data and then choose to extend the plot however you like by interacting directly with Bokeh.

Plot functions in Hail accept data in the form of either Python objects or Table and MatrixTable fields.

histogram Create a histogram.
scatter Create a scatterplot.
qq Create a Quantile-Quantile plot.
hail.plot.histogram(data, range=None, bins=50, legend=None, title=None)[source]

Create a histogram.

Parameters:
  • data (Struct or Float64Expression) – Sequence of data to plot.
  • range (Tuple[float]) – Range of x values in the histogram.
  • bins (int) – Number of bins in the histogram.
  • legend (str) – Label of data on the x-axis.
  • title (str) – Title of the histogram.
Returns:

bokeh.plotting.figure.Figure

hail.plot.scatter(x, y, label=None, title=None, xlabel=None, ylabel=None, size=4)[source]

Create a scatterplot.

Parameters:
  • x (List[float] or Float64Expression) – List of x-values to be plotted.
  • y (List[float] or Float64Expression) – List of y-values to be plotted.
  • label (List[str] or StringExpression) – List of labels for x and y values, used to assign each point a label (e.g. population)
  • title (str) – Title of the scatterplot.
  • xlabel (str) – X-axis label.
  • ylabel (str) – Y-axis label.
  • size (int) – Size of markers in screen space units.
Returns:

bokeh.plotting.figure.Figure

hail.plot.qq(pvals)[source]

Create a Quantile-Quantile plot. (https://en.wikipedia.org/wiki/Q-Q_plot)

Parameters:pvals (List[float] or Float64Expression) – P-values to be plotted.
Returns:bokeh.plotting.figure.Figure