Introduction to Luxor

Luxor is a Julia package for drawing simple static vector graphics. It provides basic drawing functions and utilities for working with shapes, polygons, clipping masks, PNG images, turtle graphics, and simple animations.

The focus of Luxor is on simplicity and ease of use: it should be easier to use than plain Cairo.jl, with shorter names, fewer underscores, default contexts, and simplified functions.

Luxor is thoroughly procedural and static: your code issues a sequence of simple graphics 'commands' until you've completed a drawing, then the results are saved into a PDF, PNG, SVG, or EPS file.

There are some Luxor-related videos on YouTube, and some Luxor-related blog posts at cormullion.github.io/.

Luxor isn't interactive: for interactive graphics, look at Gtk.jl, GLVisualize, and Makie.

Please submit issues and pull requests on GitHub. Original version by cormullion, much improved with contributions from the Julia community.

How can you contribute?

If you know any geometry you probably know more than me, so there are plenty of improvements to algorithms waiting to be made. There are some TODO comments sprinkled through the code, but plenty more opportunities for improvement.

Update the code, most of which was written for Julia versions 0.2, v0.3 and 0.4 (remember when broadcasting wasn't a thing?) so there are probably many areas where the code could take more advantage of version 1.

There can always be more tests, as the present tests are mainly visual, showing that something works, but there should be much more testing of things that shouldn't work - inappropriate input, overlapping polygons, coincident or collinear points, anticlockwise polygons, etc.

More systematic error-handling particularly of geometry errors would be a good idea, rather than sprinkling throw(error())s around when things look wrong.

Installation and basic usage

Install the package using the package manager:

] add Luxor

Cairo.jl and Colors.jl will be installed if necessary.

To use Luxor, type:

using Luxor

To test:

julia> @svg juliacircles()

or

julia> @png juliacircles()

which should create a graphic file and possibly also display and/or open it, depending on your environment.

Documentation

This documentation was built using Documenter.jl.

Documentation built 2020-05-28T12:38:22.598 with Julia 1.3.1