On Friday, February 7, 2014 11:01:16 AM UTC-5, Eric Libby wrote:
>
> Thanks! The only issue I had with plots in IJulia was that I could not 
> find a way to actually export or save them. Each time I kept getting blank 
> documents. I want to be able to export them as publication quality 
> (dpi=300). How do I do that from IJulia? Thanks
>

There are several ways.

For PyPlot plots, you can just use the savefig command, e.g.

      plot(x,y)
      savefig("myplot.eps")

where for publication quality you generally want to save to a vector format 
like EPS, PDF, or SVG.

Given a figure object (returned e.g. by gcf() in PyPlot), you can also use 
writemime to write it to one of these formats, e.g:

      plot(x,y)
      open("myplot.pdf", "w") do io
            writemime(io, "image/pdf", gcf())
      end

This is less convenient than savefig, but I mention it because most of the 
other plotting packages for Julia also support writemime (since writemime 
is also used to display their plots in Julia).

Finally, you can use IPython's powerful nbconvert tool 
(http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html) to 
convert a notebook, including figures, to a variety of formats for 
publication.  However, by default PyPlot only stores display-quality PNGs 
in the notebook, so you have to enable SVG notebook output by 
PyPlot.svg(true) first.  See: 
https://github.com/stevengj/PyPlot.jl#svg-output-in-ijulia

--SGJ
 

Reply via email to