plot¶
Plotting functions.
- multidms.plot.color_gradient_hex(start, end, n)¶
Get a list of colors linearly spanning a range.
- Parameters:
- Returns:
List of hex codes for colors spanning start to end.
- Return type:
Example
>>> import multidms.plot as mplt >>> mplt.color_gradient_hex('white', 'red', n=5) ['#ffffff', '#ffbfbf', '#ff8080', '#ff4040', '#ff0000']
- multidms.plot.ge_landscape(model, fitness_col='measured_fitness', color_by='condition', point_size=5, point_opacity=0.3, curve_color='grey', curve_width=3, width=500, height=400, n_curve_points=200)¶
Plot the global epistasis landscape.
Overlays per-variant fitness scores on the global epistasis curve
g(φ), showing how the nonlinear transformation maps latent phenotype to observed fitness. Wildtype latent phenotypes for each condition are shown as dashed vertical reference lines.- Parameters:
model (multidms.Model) – A fitted Model object.
fitness_col (str) – Which fitness column to plot on the y-axis:
'measured_fitness'or'predicted_fitness'. Default is'measured_fitness'.color_by (str) – Column to color scatter points by. Default is
'condition'.point_size (float) – Size of scatter points. Default is 5.
point_opacity (float) – Opacity of scatter points. Default is 0.3.
curve_color (str) – Color of the
g(φ)curve. Default is'grey'.curve_width (float) – Stroke width of the
g(φ)curve. Default is 3.width (int) – Chart width in pixels. Default is 500.
height (int) – Chart height in pixels. Default is 400.
n_curve_points (int) – Number of points for the
g(φ)curve grid. Default is 200.
- Returns:
Altair layered chart with scatter, curve, and wildtype reference lines.
- Return type:
alt.LayerChart