Viz
rpps.viz ¶
Visualization helpers. rpps' figures use STYLE (a matplotlib style, default "dark_background"; None: whatever
matplotlib is set to); importing this module no longer changes the style of anyone else's figures
Modules:
| Name | Description |
|---|---|
base |
Generic viz wrappers |
save |
|
utils |
|
base ¶
Generic viz wrappers
Functions:
| Name | Description |
|---|---|
show |
Show plots |
styled |
A context in which new figures and axes get |
figure |
Create a new figure |
subplot |
Create/get a subplot |
subplots |
Create subplots |
ion |
Enable interactive mode |
ioff |
Disable interactive mode |
cla |
Clear axes |
pause |
Pause |
axes |
ax, or the axes of a new figure when it is None (kw: for plt.subplots) |
line |
Plot y against x and return the line. ax: axes (None: a new figure), or the line an earlier call returned, which is |
show ¶
styled ¶
A context in which new figures and axes get STYLE (nothing when it is None)
figure ¶
subplot ¶
subplots ¶
ion ¶
ioff ¶
cla ¶
pause ¶
axes ¶
line ¶
Plot y against x and return the line. ax: axes (None: a new figure), or the line an earlier call returned, which is updated in place (an animation). title/left/right: the centre, left and right titles; grid: its alpha
Source code in src/rpps/viz/base.py
save ¶
Classes:
| Name | Description |
|---|---|
FFmpegMP4 |
with rp.viz.save.FFmpegMP4(fig, fps, "video.mp4") as writer: |
FFmpegMP4 ¶
with rp.viz.save.FFmpegMP4(fig, fps, "video.mp4") as writer: ... plt.plot() ... writer.grab_frame()
writer = rp.viz.save.FFmpegMP4(fig, fps, "video.mp4") writer.open() ... writer.close()