API reference¶
imshow (*args, **kwargs) |
Adaptive heatmap version of Axes.imshow . |
matshow (*args, **kwargs) |
Adaptive heatmap version of Axes.matshow . |
pcolor (*args, **kwargs) |
Adaptive heatmap version of Axes.pcolor . |
pcolormesh (*args, **kwargs) |
Adaptive heatmap version of Axes.pcolormesh . |
hexbin (*args, **kwargs) |
Adaptive heatmap version of Axes.hexbin . |
hist2d (*args, **kwargs) |
Adaptive heatmap version of Axes.hist2d . |
cumhist (data[, normed, ylabel, ax]) |
Plot cumulative distribution of data . |
High-level interface¶
-
adaptiveheatmap.
imshow
(*args, **kwargs)¶ Adaptive heatmap version of
Axes.imshow
.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.imshow
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.imshow
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
. - ah_kw (dict) – Keyword arguments passed to
AdaptiveHeatmap.make
.
Returns: ah –
ah.result
holds whateverAxes.imshow
returns.Return type: Examples
-
adaptiveheatmap.
matshow
(*args, **kwargs)¶ Adaptive heatmap version of
Axes.matshow
.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.matshow
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.matshow
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
. - ah_kw (dict) – Keyword arguments passed to
AdaptiveHeatmap.make
.
Returns: ah –
ah.result
holds whateverAxes.matshow
returns.Return type: Examples
-
adaptiveheatmap.
pcolor
(*args, **kwargs)¶ Adaptive heatmap version of
Axes.pcolor
.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.pcolor
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.pcolor
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
. - ah_kw (dict) – Keyword arguments passed to
AdaptiveHeatmap.make
.
Returns: ah –
ah.result
holds whateverAxes.pcolor
returns.Return type: Examples
-
adaptiveheatmap.
pcolormesh
(*args, **kwargs)¶ Adaptive heatmap version of
Axes.pcolormesh
.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.pcolormesh
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.pcolormesh
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
. - ah_kw (dict) – Keyword arguments passed to
AdaptiveHeatmap.make
.
Returns: ah –
ah.result
holds whateverAxes.pcolormesh
returns.Return type: Examples
-
adaptiveheatmap.
hexbin
(*args, **kwargs)¶ Adaptive heatmap version of
Axes.hexbin
.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.hexbin
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.hexbin
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
. - ah_kw (dict) – Keyword arguments passed to
AdaptiveHeatmap.make
.
Returns: ah –
ah.result
holds whateverAxes.hexbin
returns.Return type: Examples
-
adaptiveheatmap.
hist2d
(*args, **kwargs)¶ Adaptive heatmap version of
Axes.hist2d
.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.hist2d
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.hist2d
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
. - ah_kw (dict) – Keyword arguments passed to
AdaptiveHeatmap.make
.
Returns: ah –
ah.result
holds whateverAxes.hist2d
returns.Return type: Examples
Low-level interface¶
-
class
adaptiveheatmap.
AdaptiveHeatmap
(ax_main, ax_cdf, cax_quantile, cax_original, gs=None)¶ Four-panel figure for visualizing heatmaps.
-
ax_main
¶ matplotlib.axes.Axes
– Axes to plot the heatmap.
-
ax_cdf
¶ matplotlib.axes.Axes
– Axes to plot the cumulative distribution function (CDF).
-
cax_quantile
¶ matplotlib.axes.Axes
– Vertical colorbar along the cumulative distribution function (CDF) axis.
-
cax_original
¶ matplotlib.axes.Axes
– Horizontal colorbar in the original Z-space.
-
figure
¶
-
norm
¶
-
contour
(*args, **kwargs)¶ Run
Axes.contour
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.contour
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.contour
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.contour
returns.
-
contourf
(*args, **kwargs)¶ Run
Axes.contourf
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.contourf
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.contourf
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.contourf
returns.
-
hexbin
(*args, **kwargs)¶ Run
Axes.hexbin
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.hexbin
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.hexbin
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.hexbin
returns.
-
hist2d
(*args, **kwargs)¶ Run
Axes.hist2d
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.hist2d
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.hist2d
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.hist2d
returns.
-
imshow
(*args, **kwargs)¶ Run
Axes.imshow
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.imshow
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.imshow
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.imshow
returns.
-
classmethod
make
(cax_quantile_width_ratio=0.1, ax_cdf_width_ratio=0.5, cax_original_height_ratio=0.1, figure=None, **kwargs)¶ Create an
AdaptiveHeatmap
usingGridSpec
.Parameters: - cax_original_height_ratio (float) – The ratio of the height of
cax_original
toax_main
. - cax_quantile_width_ratio (float) – The ratio of the width of
cax_quantile
toax_main
. - ax_cdf_width_ratio (float) – The ratio of the width of
ax_quantile
toax_main
.
- cax_original_height_ratio (float) – The ratio of the height of
-
matshow
(*args, **kwargs)¶ Run
Axes.matshow
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.matshow
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.matshow
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.matshow
returns.
-
pcolor
(*args, **kwargs)¶ Run
Axes.pcolor
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.pcolor
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.pcolor
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.pcolor
returns.
-
pcolormesh
(*args, **kwargs)¶ Run
Axes.pcolormesh
with adaptive heatmap colorbar.Parameters: - *args –
- **kwargs – All positional and keyword arguments are passed to
Axes.pcolormesh
and use its default, except for the following keyword arguments. - norm (QuantileNormalize) – Unlike
Axes.pcolormesh
,norm
here defaults to an instance ofQuantileNormalize
initialized with the data passed to this function. - norm_kw (dict) – Keyword arguments passed to
QuantileNormalize
.
Returns: Return type: Whatever
Axes.pcolormesh
returns.
-
relate_xyzq
(x, y, marker='o', color='k', noline=False)¶ Plot auxiliary lines and points to relate data at
(x, y)
.
-
set_zlabel
(label)¶ Set “z-axis” label of
cax_quantile
.
-
-
class
adaptiveheatmap.
QuantileNormalize
(qs=None, quantile=None, **kwargs)¶ Data normalization based on quantile function (inverse CDF).
-
qs
¶ None, int or array – If an int,
qs
-quantiles are used; i.e., it is converted to an array byqs = numpy.linspace(0, 1, qs + 1)
. If an array, it must be an increasing sequence of numbers between 0 and 1 (qs * 100
is passed tonumpy.nanpercentile
). Note that usuallyqs
should start at 0 (qs[0] == 0
) and end at 1 (qs[-1] == 1
) unless it is preferred to ignore extreme values.
-
quantile
¶ array – Sorted values on the original data space.
-
vmin, vmax
float
-
clip
¶ bool – See:
matplotlib.colors.Normalize
.
-
autoscale
(data)¶ Set vmin, vmax to min, max of A.
-
autoscale_None
(data)¶ autoscale only None-valued vmin or vmax.
-
scaled
()¶ return true if vmin and vmax set
-