5 Minute Introduction to Nextjournal
The Nextjournal editor is your interface to creating fully reproducible notebooks that feature interactive, runnable environments and rich media.
This short guide takes you through adding code and data, plotting, and manipulating the environment.
Click on Add new content or use the ➕ insert menu to add paragraphs, section headings, code cells, lists, and more.
Select a language to insert a cell. Write some code and press shift enter to run the cell. Use the ··· action menu to make changes to the cell itself.
Both the ➕ insert menu and the ··· action menu are exposed when selecting or hovering over notebook elements like paragraphs or code cells.
Upload data to Nextjournal using the file command under the ➕ insert menu.
Bash cells are special case code cells. These cells have access to the notebooks's filesystem on the command line. This is useful for processing data, downloading files, and installing packages.
Every language on Nextjournal supports default plotting libraries. Notebooks automatically display the associated plot below each cell. For example, using
ggplot2 in R:
library(ggplot2) attach(iris) plot(Petal.Length, Petal.Width, col=Species, pch=19)
Languages can coexist side-by-side in a notebook and share data and results. For example, the above R plot will now be followed by a Python plot using our default Python environment.
Note the reference to
cubic.csv, which was uploaded earlier. The data is read by
pandas and can be plotted using
plotly. All these packages are available by default - no installation or configuration required!
import plotly.plotly as py from plotly.graph_objs import * data = [Scatter(y=df.iloc[:,0])] layout = Layout() Figure(data=data, layout=layout)
As an example, install the venerable Linux utility
apt-get update apt-get install -y cowsay
cowsay and see what the cow says:
cowsay "Go forth and remix!"
Nextjournal promises complete reproducibility across your entire project. For a broad overview what what makes Nextjournal different from other notebooks and development environments, check out Why Nextjournal.