| CARBONIAN-NOTEBOOK(1) | Carbonian Manual | CARBONIAN-NOTEBOOK(1) |
carbonian-notebook - IPython with plots drawn in the terminal, in the palette's colours
carbonian-notebook [demo | console | FILE.py | IPYTHON-ARGS]
Starts IPython with a matplotlib backend that sends each figure to the terminal as a sixel picture (foot, and tmux 3.8) sized to the pane, in the colours of the current palette. With no argument it opens an IPython session; plt.show() draws the figures in the pane.
tmux keeps sixel pictures only on the visible screen: after a resize they are dropped, and they are not in the scrollback. In IPython, %figs shows the last 20 figures one at a time on a screen of their own (Right, n, j or space: next; Left, p or k: previous; g, G: first, last; q or Esc: leave), drawn again at every resize, and %replot (also %redraw) clears the screen and draws them again once. In the viewer, s saves the figure on show as a PNG file and S saves them all, in ~/Pictures/figures (or CARBONIAN_MPLSIXEL_SAVEDIR); the viewer fits the figure to the window keeping its proportion and shows a line about it. %savefigs [DIR] saves them without the viewer.
The package also ships a ggplot2 theme for R in the palette's colours and a way to print ggplot figures in the terminal as sixel pictures. Install the R packages first (they are only suggested, R is large): sudo apt install r-cran-ggplot2 r-cran-ragg Then /usr/lib/carbonian/notebook/carbonian_ggplot.py --install writes ~/.config/carbonian/ggplot.R and source("~/.config/carbonian/ggplot.R"); carbonian_sixel(TRUE) (in ~/.Rprofile to make it permanent) makes each plot print in the pane. R figures do not go through %figs; a PNG made with png() can be opened with carbonian-view(1).
A Julia notebook (a kernel named julia) is run cell by cell by jnb, which loads CairoMakie when a cell mentions Makie, saves each displayed Makie figure as a picture, and takes the palette from ~/.config/carbonian/makie.jl (theme_carbonian(); the palette hook 60-makie keeps it up to date). Julia is only suggested (it is large and not in Debian): install it from julialang.org or with juliaup, then carbonian-jnb --setup adds CairoMakie to the shared environment @carbonian. The notebook's own Project.toml wins when there is one. Make the theme file once with /usr/lib/carbonian/notebook/carbonian_makie.py --install. The 3D plots of Makie are pictures (no live turning).
The package sets R_PROFILE (/etc/environment.d/60-carbonian-r.conf, read at the next login) to /usr/lib/carbonian/R/Rprofile.site, which runs Debian's own Rprofile.site and then loads the palette for an interactive R (or when CARBONIAN_R_PALETTE is set: an Rscript that writes a PDF keeps its white page by default): base graphics and lattice at once, ggplot2's theme and scales when ggplot2 is attached. ~/.config/carbonian/ggplot.R wins when it exists. The generated files are kept in ~/.cache/carbonian/R, one pair per palette name, and made again when a new palette name shows up. CARBONIAN_PALETTE=off turns it off.
/usr/lib/carbonian/notebook
the backend, the style (carbonian_mplstyle), the R and plotnine themes and the
demos.
carbonian-view(1), ipython3(1), carbonian-palette(1), tmux(1)
| Carbonian |