Publication-quality plotting for julia using Grace/xmgrace
Switch branches/tags
Clone or download
ma-laforge Further migration to Julia v0.6.
immutable -> struct
type -> mutable struct
Latest commit fd8a978 Jun 3, 2017
Failed to load latest commit information.
src Further migration to Julia v0.6. Jun 3, 2017
test runtests.jl now just tests "using". Jun 18, 2016

🎨 Galleries (Sample Output) 🎨

📈 Sample plots (might be out of date).

Generated With Other Modules:


Build Status


The GracePlot.jl module is a simple control interface for Grace/xmgrace - providing more publication-quality plotting facilities to Julia.

  • GracePlot.jl is ideal for seeding a Grace session with plot data before fine-tuning the output with Grace itself.
  • Grace "templates" (.par) files can then be saved/re-loaded to maintain a uniform appearance in publication.
  • The user is encouraged to pre-process data using math facilities from Julia instead of those built-in to Grace.


The sample directory contains a few demonstrations on how to use GracePlot.jl.

The template directory contains a repository of sample Grace template (parameter) files.


The GracePlot.jl module requires the user to install the Grace plotting tool:

More detailed instructions can be found here


By default, GracePlot.jl assumes Grace is accessible from the environment path as xmgrace. To specify a different command/path, simply set the GRACEPLOT_COMMAND environment variable.

The value of GRACEPLOT_COMMAND can therefore be set from .juliarc.jl with the following:

ENV["GRACEPLOT_COMMAND"] = "/home/laforge/bin/xmgrace2"

Select Documentation


Objects describing axis types are created with the axes function:

log_lin = axes(xscale = :log, yscale = :lin)

Supported scales: :lin, :log, :reciprocal.

The axes function also allows the user to specify axis ranges:

ax_rng = axes(xmin = 0.1, xmax = 1000, ymin = 1000, ymax = 5000)

Line Style

Objects describing line style are created with the line function:

default_line = line(style=:ldash, width=8, color=1)

Supported styles: :none, :solid, :dot, :dash, :ldash, :dotdash, :dotldash, :dotdotdash, :dotdashdash.


Objects describing display glyphs (markers/symbols) are created with the glyph function:

glyph(shape=:diamond, color=5)

Supported shapes: :circle, :o, :square, :diamond, :uarrow, :larrow, :darrow, :rarrow, :cross, :+, :diagcross, :x, :star, :*, :char (see demo2 for use of :char).

Known Limitations

GracePlot.jl currently provides a relatively "bare-bones" interface (despite offering significant functionality).

  • Does not currently provide much in terms of input validation.
  • Does not support the entire Grace control interface.
  • In particular: GracePlot.jl does not support Grace math operations. Users are expected to leverage Julia for processing data before plotting.
  • On certain runs, Grace will complain that some commands cannot be executed... almost like commands are sent too fast for Grace, or something... Not sure what this is. Try re-running.

SVG Issues

GracePlot.jl will post-process SVG files in an attempt to support the W3C 1999 standard. The changes enable most new web browsers to display the SVG outputs. Note, however, that text will not appear correctly on these plots.

The EPS format is therefore suggested if high-quality vector plots are desired.


The ARRANGE command appears to cause crashes/logouts on certain Linux installs with relatively high occurance.


Extensive compatibility testing of GracePlot.jl has not been performed. The module has been tested using the following environment(s):

  • Linux / Julia-0.6.0-rc1 / Grace-5.1.23.


The GracePlot.jl API is not perfect. Backward compatibility issues are to be expected as the module matures.