Graphics in Julia

Several packages exist to plot data and visualize data relations; Plots and PyPlot are some of the most commonly used:

  • PyPlot: (refer to the Installing and working with Jupyter section in Chapter 1, Installing the Julia Platform) This package works with no overhead through the PyCall package. The following is a summary of the main commands:
    • plot(y), plot(x,y) plots y versus 0,1,2,3 or versus x:loglog(x,y)
    • semilogx(x,y), semilogy(x,y) for log scale plots
    • title("A title"), xlabel("x-axis"), and ylabel("foo") to set labels
    • legend(["curve 1", "curve 2"], "northwest") to write a legend at the upper-left
    • grid(), axis( "equal") adds grid lines, and uses equal x and y scaling
    • title(L"the curve $e^\sqrt{x}$") sets the title with ...

Get Julia 1.0 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.