utils.draw.plot_distribution_curves¶
Function ยท Source
mdnc.utils.draw.plot_distribution_curves(
gen, method='mean', level=3, outlier=0.1,
xlabel=None, ylabel='value', y_log=False,
figure_size=(6, 5.5), legend_loc=None, legend_col=None,
fig=None, ax=None
)
Plot lines with multi-level distribution for multiple data groups. Each group is given by:
- one 1D array and one 2D array, representing the x axis (assuming to have a shape of
(N,)
) and a stack of data samples (with a shape of(N, M)
). Each time point corresponds toM
samples in the same distribution. - or a 2D array. In this case, we only have the
(N, M)
data stack.
Tip
This function has similar meaning of plot_error_curves
. It is used for compressing the time-series histograms. Its output is similar to tensorboard.distribution.
Arguments¶
Requries
Argument | Type | Description |
---|---|---|
gen | object | A generator callable object (function), each yield returns a sample. It allows users to provide an extra kwargs dict for each iteration (see Examples). For each iteration, it returns 4 1D arrays, or 2 2D arrays, or 2 1D arrays, or a 4D array, or a 2D array, or a 1D array. |
method | str | The method for calculating curves, could be 'mean' or 'middle' , representing the mean value and the median value respectively. |
level | int | The histogram level. |
outlier | float | Outlier proportion (should be 0~1), the part marked as outliers would be thrown away when drawing the figures. |
xlabel | str | The x axis label. |
ylabel | str | The y axis label. |
y_log | bool | A flag. Whether to convert the y axis into the logarithmic format. |
figure_size | (float, float) | A tuple with two values representing the (width, height) of the output figure. The unit is inch. |
legend_loc | str orint or(float, float) | The localtion of the legend, see matplotlib.pyplot.legend to view details. (The legend only works when passing label to each iteration). |
legend_col | int | The number of columns of the legend, see matplotlib.pyplot.legend to view details. (The legend only works when passing label to each iteration). |
fig | object | A matplotlib figure instance. If not given, would use plt.gcf() for instead. |
ax | object | A matplotlib subplot instance. If not given, would use plt.gca() for instead. |
Examples¶
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Last update: March 14, 2021