Some plotting examples, with no exhaustive documentation.
# Necessary import evil
import physt
from physt import h1, h2, histogramdd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
np.random.seed(42)
from physt import plotting
# Some data
x = np.random.normal(100, 1, 10000)
y = np.random.normal(10, 10, 10000)
ax = h2(x, y, 15).plot(figsize=(6, 6), show_zero=False, alpha=0, text_color="black", show_values=True, cmap="BuGn_r", show_colorbar=False, transform=lambda x:1)
h2(x, y, 50).plot.image(cmap="Spectral_r", alpha=0.75, ax=ax)
<matplotlib.axes._subplots.AxesSubplot at 0x7f88f8266f28>
h2(x, y, 40, name="Gauss").plot("image", cmap="rainbow", figsize=(5, 5))
<matplotlib.axes._subplots.AxesSubplot at 0x7f88f6dd1b38>
plotting.matplotlib.bar3d(h2(x, y, 10, name="Gauss"), figsize=(5, 5), cmap="Accent");
h1(x, "human", 10, name="Gauss").plot(ylim=(100, 1020), cmap="Greys", ticks="edge", errors=True);
h1(x, "human", 200, name="Gauss").plot.line(errors=True, yscale="log")
<matplotlib.axes._subplots.AxesSubplot at 0x7f88f5e8a9e8>
h1(x, "human", 200, name="Gauss").plot.fill(lw=1, alpha=.4, figsize=(8, 4))
h1(x, "human", 200, name="Gauss").plot.fill(lw=1, alpha=.4, yscale="log", figsize=(8, 4), color="red")
<matplotlib.axes._subplots.AxesSubplot at 0x7f88f5c3ef28>
h1(x, "human", 200, name="Gauss").plot.scatter(errors=True, xlim=(90, 100), show_stats=True)
<matplotlib.axes._subplots.AxesSubplot at 0x7f88f5b386a0>
#h = h1(x, "human", 200, name="Gauss")
#ax = h.plot("scatter", cumulative=True, s=3, transform=lambda x: np.sin(x / 500), cmap="rainbow")
# h.plot.line(ax=ax, cumulative=True)
ha = h1(x, "human", 20, name="Left")
hb = h1(x + 1 * np.sin(x / 12), "human", 40, name="Right")
from physt.plotting.matplotlib import pair_bars
pair_bars(ha, hb, density=True, errors=True, figsize=(5, 5));
/home/honza/code/my/physt-0.3/physt/histogram_base.py:854: FutureWarning: Conversion of the second argument of issubdtype from `int` to `np.signedinteger` is deprecated. In future, it will be treated as `np.int64 == np.dtype(int).type`. /home/honza/code/my/physt-0.3/physt/histogram_base.py:854: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.