Creating geometry plots with Julia

250 views
Skip to first unread message

Erik Schnetter

unread,
Sep 26, 2014, 8:25:29 PM9/26/14
to julia...@googlegroups.com
I want to create plots with Julia. The graphs will consist of many points and line segments. Currently, I'm using Gadfly, and I'm creating one layer per plot element (point or line). This works, but seems slow.

(1) Should I be using Gadfly differently? Can you point me to an example or documentation?
(2) Should I be using Gadfly at all? Gadfly is advertised for statistics, which isn't what I'm trying to plot -- I have geometry data.

-erik

Jason Merrill

unread,
Sep 26, 2014, 8:31:00 PM9/26/14
to julia...@googlegroups.com
You might consider Compose, which is the geometry layer that sits below Gadfly.

Or if you really want to get down to nuts and bolts, you could just use Cairo directly.

Tim Holy

unread,
Sep 26, 2014, 8:34:03 PM9/26/14
to julia...@googlegroups.com
Using Cairo directly is not crazy. It's not that hard to use, and you get a
lot of control.

Winston is also a good choice; it's pretty high performance, though neither
Cairo nor Winston is in OpenGL territory. Winston is not as flexibly as Gadfly,
but it is more performant.

--Tim

Erik Schnetter

unread,
Sep 26, 2014, 8:34:23 PM9/26/14
to julia...@googlegroups.com
Thanks -- I'll have a look at Compose.

Cairo doesn't build for me; I'm outputting to SVG which works without Cairo.

-erik

On Fri, Sep 26, 2014 at 8:31 PM, Jason Merrill <jwme...@gmail.com> wrote:
> You might consider Compose, which is the geometry layer that sits below Gadfly.
>
> Or if you really want to get down to nuts and bolts, you could just use Cairo directly.



--
Erik Schnetter <schn...@cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/

Jason Merrill

unread,
Sep 26, 2014, 9:10:49 PM9/26/14
to julia...@googlegroups.com
You should file an issue against Cairo. If you can't get it working in the long run, you'll be missing out on some important, widely used infrastructure.

Ariel Keselman

unread,
Sep 27, 2014, 5:05:38 PM9/27/14
to julia...@googlegroups.com
I just did something like what you describe and the following method worked very fast:

Don't use layers. Instead use Nan's to cut the line. So for eg. An array 1,2,3,nan,4,5,6 will draw as two lines.

Erik Schnetter

unread,
Sep 27, 2014, 5:43:33 PM9/27/14
to julia...@googlegroups.com
Thanks; I should have thought of nans myself.

I'm now using Compose. This works beautifully and is fast. The only
issue is that it doesn't scale the graph automatically, i.e. one has
to choose the size of the graph manually. That's fine for the moment,
and if not, I'm sure it's easy to implement a walk over the compose
tree.

-erik


On Sat, Sep 27, 2014 at 5:05 PM, Ariel Keselman <ska...@gmail.com> wrote:
> I just did something like what you describe and the following method worked very fast:
>
> Don't use layers. Instead use Nan's to cut the line. So for eg. An array 1,2,3,nan,4,5,6 will draw as two lines.



Reply all
Reply to author
Forward
0 new messages