I want to create a plot using Gadfly in Julia programming language and the html or jupyter notebook output is as it should; including the correct local font theme (here for example a Bold Avenir). But when I try to save the image (e.g. as pdf, doesn't matter) the theme seems to switch to a default style. The following minimal example shows my problem. I have a Mac (OSX El Capitan), julia version 0.4.5 and following required packages installed: Atom (0.4.2), Cairo (0.2.33), Gadfly (0.4.2), Homebrew (0.3.2), IJulia (1.1.10).
using Gadfly
using Cairo
p = plot(x=randn(2000), Geom.histogram(bincount=100),
Theme(
minor_label_font="AvenirNext-Bold",
major_label_font="AvenirNext-Bold",
key_label_font="AvenirNext-Bold"))
draw(PDF("histo.pdf", 800px, 400px), p)
The image with the correct theme (Bold Avenir Font):
The saved image with a different theme (default font?):
I would be very glad if you can help me.