Subplots
make_subplots(subfig_list, shape, title=None, column_widths=None, fill_row=False, shared_xaxes=False, shared_yaxes=False, plotly_kwargs=None, show_legend=False, size=None, show=True, write_html_path=None)
¶
Creates subplots using a provided list of figure objects.
plotly.subplots.make_subplots
requires the use of traces. This function
is an alternative implementation that directly uses previously-created
figure objects.
Example:
from blitzly.subplots import make_subplots
from blitzly.plots.histogram import simple_histogram
import numpy as np
fig1 = simple_histogram(np.random.randn(100), show=False)
fig2 = simple_histogram(np.random.randn(100), show=False)
make_subplots([fig1, fig2], (1, 2))
Parameters:
Name | Type | Description | Default |
---|---|---|---|
subfig_list |
List[BaseFigure]
|
A list of figure objects. |
required |
shape |
Tuple[int, int]
|
The grid shape of the subplots. |
required |
title |
str
|
Title of the plot. |
None
|
column_widths |
Optional[List[float]]
|
The width of each column in the subplot grid. |
None
|
fill_row |
bool
|
If True, resize the last subplot in the grid to fill the row. |
False
|
shared_xaxes |
bool
|
Share the x-axis labels along each column. |
False
|
shared_yaxes |
bool
|
Share the y-axis labels along each row. |
False
|
plotly_kwargs |
Optional[dict]
|
Additional keyword arguments to pass to Plotly |
None
|
show_legend |
bool
|
Whether to show the legend. |
False
|
size |
Optional[Tuple[int, int]
|
Size of the plot. |
None
|
show |
bool
|
Whether to show the figure. |
True
|
write_html_path |
Optional[str]
|
The path to which the histogram should be written as an HTML file. If None, the histogram will not be saved. |
None
|
Returns:
Name | Type | Description |
---|---|---|
BaseFigure |
BaseFigure
|
The provided list figures as subplots in a single figure object. |
Source code in blitzly/subplots.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|