GithubHelp home page GithubHelp logo

briochemc / juliaproplotexamples Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 1.0 1.36 MB

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

License: MIT License

Julia 100.00%
julia plots proplot examples tutorials pyplot python matplotlib cartopy plotting

juliaproplotexamples's Introduction

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/.

juliaproplotexamples's People

Contributors

briochemc avatar natgeo-wong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

natgeo-wong

juliaproplotexamples's Issues

images

Basics

Figures and subplots

Figures-and-subplots-1
Figures-and-subplots-2
Figures-and-subplots-3

Formatting subplots

Formatting-subplots

Changing rc settings

Changing-rc-settings

Subplot grids

Subplot-grids

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.