mirror of https://github.com/mpastell/Weave.jl
Added tests for plotjl/generic multimedia
parent
daa645ac58
commit
b6031cd111
|
@ -7,15 +7,15 @@ examples/*.pdf
|
||||||
examples/*.html
|
examples/*.html
|
||||||
examples/*.rst
|
examples/*.rst
|
||||||
examples/*.tex
|
examples/*.tex
|
||||||
test/documents/figures
|
test/**/cache
|
||||||
test/documents/cache
|
test/**/figures
|
||||||
test/documents/output/figures
|
|
||||||
test/documents/output/gadfly_formats_test.txt
|
test/documents/output/gadfly_formats_test.txt
|
||||||
test/**/*.tex
|
test/**/*.tex
|
||||||
test/**/*.md
|
test/**/*.md
|
||||||
test/**/*.rst
|
test/**/*.rst
|
||||||
test/**/*.html
|
test/**/*.html
|
||||||
test/**/*.pdf
|
test/**/*.pdf
|
||||||
|
test/**/*.png
|
||||||
test/**/chunk_options.jl
|
test/**/chunk_options.jl
|
||||||
!test/**/*ref.*
|
!test/**/*ref.*
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
|
||||||
|
|
||||||
|
~~~~{.julia}
|
||||||
|
using Plots
|
||||||
|
pyplot()
|
||||||
|
x = linspace(0, 2*pi)
|
||||||
|
println(x)
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
~~~~
|
||||||
|
linspace(0.0,6.283185307179586,50)
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
~~~~{.julia}
|
||||||
|
p = plot(x = x, y = sin(x), size =(900,300))
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
~~~~
|
||||||
|
[Plots.jl] Initializing backend: pyplot
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
~~~~{.julia}
|
||||||
|
julia> plot(x = x, y = sin(x))
|
||||||
|
Plot{Plots.PyPlotBackend() n=1}
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
![](figures/plotsjl_test_2_1.png)\
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
~~~~{.julia}
|
||||||
|
plot(rand(100) / 3,reg=true,fill=(0,:green))
|
||||||
|
scatter!(rand(100),markersize=6,c=:orange)
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
![](figures/plotsjl_test_3_1.png)\
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
~~~~{.julia}
|
||||||
|
julia> plot(rand(100) / 3,reg=true,fill=(0,:green))
|
||||||
|
|
||||||
|
Plot{Plots.PyPlotBackend() n=1}
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
![](figures/plotsjl_test_4_1.png)\
|
||||||
|
|
||||||
|
|
||||||
|
~~~~{.julia}
|
||||||
|
julia> scatter!(rand(100),markersize=6,c=:orange)
|
||||||
|
Plot{Plots.PyPlotBackend() n=2}
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
![](figures/plotsjl_test_4_2.png)\
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
![A random walk.](figures/plotsjl_test_random_1.png)
|
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
|
||||||
|
\begin{juliacode}
|
||||||
|
using Plots
|
||||||
|
pyplot()
|
||||||
|
x = linspace(0, 2*pi)
|
||||||
|
println(x)
|
||||||
|
|
||||||
|
\end{juliacode}
|
||||||
|
\begin{juliaout}
|
||||||
|
linspace(0.0,6.283185307179586,50)
|
||||||
|
\end{juliaout}
|
||||||
|
|
||||||
|
\begin{juliacode}
|
||||||
|
p = plot(x = x, y = sin(x), size =(900,300))
|
||||||
|
\end{juliacode}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{juliaterm}
|
||||||
|
julia> plot(x = x, y = sin(x))
|
||||||
|
Plot{Plots.PyPlotBackend() n=1}
|
||||||
|
\end{juliaterm}
|
||||||
|
\includegraphics[width=\linewidth]{figures/plotsjl_test_2_1.pdf}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{juliacode}
|
||||||
|
plot(rand(100) / 3,reg=true,fill=(0,:green))
|
||||||
|
scatter!(rand(100),markersize=6,c=:orange)
|
||||||
|
\end{juliacode}
|
||||||
|
\includegraphics[width=\linewidth]{figures/plotsjl_test_3_1.pdf}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{juliaterm}
|
||||||
|
julia> plot(rand(100) / 3,reg=true,fill=(0,:green))
|
||||||
|
|
||||||
|
Plot{Plots.PyPlotBackend() n=1}
|
||||||
|
\end{juliaterm}
|
||||||
|
\includegraphics[width=\linewidth]{figures/plotsjl_test_4_1.pdf}
|
||||||
|
|
||||||
|
\begin{juliaterm}
|
||||||
|
julia> scatter!(rand(100),markersize=6,c=:orange)
|
||||||
|
Plot{Plots.PyPlotBackend() n=2}
|
||||||
|
\end{juliaterm}
|
||||||
|
\includegraphics[width=\linewidth]{figures/plotsjl_test_4_2.pdf}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{figure}[htpb]
|
||||||
|
\center
|
||||||
|
\includegraphics[width=\linewidth]{figures/plotsjl_test_random_1.pdf}
|
||||||
|
\caption{A random walk.}
|
||||||
|
\label{fig:random}
|
||||||
|
\end{figure}
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Weave, Compat
|
||||||
|
using Base.Test
|
||||||
|
|
||||||
|
function pljtest(source, resfile, doctype)
|
||||||
|
weave("documents/$source", out_path = "documents/plotsjl/$resfile", doctype=doctype, plotlib=nothing)
|
||||||
|
result = @compat readstring(open("documents/plotsjl/$resfile"))
|
||||||
|
ref = @compat readstring(open("documents/plotsjl/$resfile.ref"))
|
||||||
|
@test result == ref
|
||||||
|
end
|
||||||
|
|
||||||
|
pljtest("plotsjl_test.jmd", "plotsjl_test.md", "pandoc")
|
||||||
|
pljtest("plotsjl_test.jmd", "plotsjl_test.tex", "tex")
|
|
@ -27,4 +27,7 @@ if VERSION < v"0.5-dev"
|
||||||
|
|
||||||
info("Test: Weaving with PyPlot")
|
info("Test: Weaving with PyPlot")
|
||||||
include("pyplot_formats.jl")
|
include("pyplot_formats.jl")
|
||||||
|
|
||||||
|
info("Test: Weaving with Plots.jl")
|
||||||
|
include("plotsjl_test.jl")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue