Asymptote - vsevolod-ivanov/Ivanov-Group-Wiki GitHub Wiki
Asymptote is a vector graphics language that is based on TeX, making it look extremely professional and clean! It can be used to generate 3D plots, and also has interactivity built into the images (as long as they're opened with the right software).
Installing Asymptote: Windows
To install asymptote you need to have a TeX implementation working on your device first. If you don't have that already, one option is TeX Live, which you can download from here. If you are on a Windows device, you should be able to download the .exe file from here. Running this file should install asymptote. There are a few other pieces that you will need to have everything running smoothly, and you can find all the requirements here.
(Please note that I don't run on a Windows device, so there may be unanticipated issues)
Installing Asymptote: Mac
Installing asymptote on a Mac is slightly less straightforward. You may follow these directions to get everything up and running, but here is the short version:
- Install homebrew (if you have not already). To download it, run the following command:
cd /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install MacTeX (if you have not already). Installing MacTeX is easy if you use homebrew. Just run
brew install --cask mactex
- Install asymptote:
brew install asymptote
Using Asymptote: Hello World
If everything went correctly, you should be able to read/run asymptote files now. Here are the steps to create a hello_world example to make sure everything is running smoothly:
-
Create the file hello_world.asy using a text editor.
-
In this file, type: label("Hello World!");
-
Save this file and run it using the command: asy hello_world
-
This should run and output a file called hello_world.eps
-
To save this as a pdf, simply add the following line to the hello_world.asy file: settings.outformat = "pdf";
-
Running "asy hello_world" should now output a file called hello_world.pdf. Open this with your pdf viewer, and it should have text that says "Hello World!" In Computer Modern.
If everything is running smoothly, you can now create plots in asymptote. Note that asymptote functions similarly to the Tikz package for LaTeX. For example, every line ends with a semicolon, just like in Tikz.
For lots of examples of how to create plots, including 3D ones, I recommend using this tutorial, which was used extensively to create this tutorial.