Start using Pluto

What is a Notebook?

Important

The images in this section were created on a computer with the Dark Mode enabled. Except for the color pallete, everything should be positioned and work exactly the same for a user in Light Mode.

If your graphical environment isn’t as greyish, don’t worry. Although it is certainly worse for your eyes!

Notebooks are a new standard in scientific research and data analysis. They are usually open-source interactive web applications to create and share documents that bring together code (to perform computations), outputs (such as plots, tables, visualizations, etc.), and formatted text (to explain stuff). Pluto is a Julia package that creates such an environment. A Pluto Notebook is a Julia file (with a .jl) to be run inside a Pluto session.

It is structured in cells where we introduced the contents: either Julia code to be performed or text to be formatted:

Pluto runs the cells interactively within the Notebook, allowing you to see the results of your code immediately, making it great for data exploration and experimentation. Each Notebook is a full-powered Julia environment, where you may use any package available inside the language ecosystem. On the contrary to other similar softwares, Pluto Notebooks are reactive. This means that any changed code takes effect instantly and deleted code leaves no trace. «At any instant, the program state is completely described by the code you see.»

Opening a Pluto Notebook

Important

Please remember that any time you want to run Pluto you first need to run Julia. Once in julia> mode, run:

import Pluto; Pluto.run() ↩ Enter

1. Getting the Notebook Path

  1. Go to the folder where your Notebook is saved and copy the folder’s path.
  2. To obtain this path, press the mouse’s right button on top of that folder, click on Properties, and copy the path seen in the Location entry.

If you are running Windows 11, you may simply select the appropriate option from the file context menu:

However you need to remove the quote marks " that Windows stupidly adds to the the beginning and to the end of the file path…

A path looks like this:

  • Windows: C:\Users\username\Desktop\Macro1\Notebooks\Week01
  • Linux: /home/username/Desktop/Macro1/Notebooks/Week01
  • macOS: /Users/username/Desktop/Macro1/Notebooks/Week01

2. Pasting the Notebook Path into Pluto

  1. Paste that path into the appropriate box and press:
  • add a back-slash \ (if you use Windows)
  • add a forward-slash / (if you use Linux or macOS)

  1. Once the slash is added, a small window displays the files in that folder.
  2. Click only once on top of the Pluto Notebook (it should be a file ended in .jl) that you want to run and press ↩ Enter

Please be patient! It takes a while to open the first Notebook.

  1. The Notebook is ready to use when the Status panel on the bottom-right of the page stops blinking.

Running a cell and saving a Pluto Notebook

When we apply changes to a Notebook, by creating a new cell or introducing changes to an existing cell, there are two ways to run these changes:

  • To run an individual cell:
    • Click Shift+↩ Enter
    • Click on the small circle as in the figure below:

  • To run all cells and saving the entire Notebook: Ctrl+S

Exporting a Pluto Notebook

  • A Pluto Notebook can be exported in three other formats:
    • as a Julia file
    • as a HTML file
    • as a PDF file
  • There is a small icon with the export box at the top right-hand side of the monitor

  • Then choose the format of your preference