I am trying to use Weave.jl with PyPlot for plotting (on v0.7), but I am not getting any plot in the PDF or HTML document. Did someone was successful to use Weave with PyPlot? (For the moment, I am just trying to make the example julia_sample.mdw work, from Weave)
So I finally fixed my problem, thank you. I tried to to follow the example in the Weave package but it was not working. My original code looked as the following ():
## Capturing figures
The figures and code can be included in the output.
<<term=false;echo=false>>=
using PyPlot
PyPlot.close()
x = [1:1:50;];
y = 10*rand(50);
fig = figure("pyplot_barplot",figsize=(5,5))
b = bar(x,y,color="#0f87bf",align="center",alpha=0.9)
axis("tight")
title("Vertical Bar Plot")
grid(true)
xlabel("X")
ylabel("Y")
@
And when I was using weave weave(joinpath(dirname(pathof(Weave)), "../examples", "julia_example.mdw"),out_path=:pwd, doctype="md2html")
The plot was not included in the html (same thing with āmd2pdfā).
I finally add display(fig); and it finally worked.
## Capturing figures
The figures and code can be included in the output.
<<term=false;echo=false>>=
using PyPlot
PyPlot.close()
x = [1:1:50;];
y = 10*rand(50);
fig = figure("pyplot_barplot",figsize=(5,5))
b = bar(x,y,color="#0f87bf",align="center",alpha=0.9)
axis("tight")
title("Vertical Bar Plot")
grid(true)
xlabel("X")
ylabel("Y")
display(fig);
@
My personal advice is to use julia-v0.7 for the moment. Some useful packages are not yet up to date with Julia-v1, the advantage of julia-v0.7 is it will output a warning message instead of error message and it will indicate what is deprecated and what is now recommended.
I think that the examples in Weave.jl are outdated. Therefore, it is really time consuming to figure it out how it should work.