Skip to content

The proplot examples translated to Julia using PyCall.jl and PyPlot.jl.

License

Notifications You must be signed in to change notification settings

briochemc/JuliaProPlotExamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Julia ProPlot Examples

Here you will find some (most?) of the ProPlot examples from the documentation, but translated to Julia using PyCall.jl.

Note you must install ProPlot first. (And probably some other things.)

  • In order to get the colorbars to position/work properly, you need xarray. However, note that this causes glitches in LaTex formmatting (i.e. xlabel=L"$\tau$" doesn't work anymore.
  • In order to address the above, you need to install and use the Julia Package LaTeXStrings.jl. This package is inbuilt into PyPlot.jl and reexported for use, however here you must call it explicitly via using LaTeXStrings

Click on the images below to be directed to the julia code that produced it.

Basics

Figures and subplots

Formatting subplots

Changing rc settings

Subplot grids

Subplots features

Automatic figure sizing

Automatic subplot spacing

Arbitrary physical units

Subplot numbers and a-b-c labels

Shared and spanning labels

Colorbars and legends

Axes colorbars and legends

Notes

  1. Python's 0-based indexing means all the indices are shifted in these Julia examples.

  2. The scoping rules are a bit different between Python and Julia, which require some tweaking for the examples to work.

  3. You can't format all the subplots at once with axs.format AFAIK, so you have to loop through all axes and format each of them.

  4. f, axs = proplot.subplots() returns a vector of axes, even if you specify multiple columns, so that you need to reshape (and transpose) the axs array to get access to the axes in Cartesian coordinates (i.e., as in axs[i,j]).

  5. I saved the images via f.savefig("X.svg", transparent=false) in figs/.