tests and readme
@ -3,7 +3,7 @@
|
||||
[](https://travis-ci.org/tbreloff/Plots.jl)
|
||||
[](http://pkg.julialang.org/?pkg=Plots&ver=0.3)
|
||||
[](http://pkg.julialang.org/?pkg=Plots&ver=0.4)
|
||||
[](https://coveralls.io/r/tbreloff/Plots.jl?branch=master)
|
||||
<!-- [](https://coveralls.io/r/tbreloff/Plots.jl?branch=master) -->
|
||||
[](http://codecov.io/github/tbreloff/Plots.jl?branch=master)
|
||||
|
||||
#### Author: Thomas Breloff (@tbreloff)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
[](https://travis-ci.org/tbreloff/Plots.jl)
|
||||
[](http://pkg.julialang.org/?pkg=Plots&ver=0.3)
|
||||
[](http://pkg.julialang.org/?pkg=Plots&ver=0.4)
|
||||
[](https://coveralls.io/r/tbreloff/Plots.jl?branch=master)
|
||||
<!-- [](https://coveralls.io/r/tbreloff/Plots.jl?branch=master) -->
|
||||
[](http://codecov.io/github/tbreloff/Plots.jl?branch=master)
|
||||
|
||||
#### Author: Thomas Breloff (@tbreloff)
|
||||
|
||||
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 25 KiB |
@ -25,7 +25,15 @@ function getPyPlotLineStyle(linetype::Symbol, linestyle::Symbol)
|
||||
end
|
||||
|
||||
function getPyPlotMarker(marker::Shape)
|
||||
marker.vertices
|
||||
n = length(marker.vertices)
|
||||
mat = zeros(n+1,2)
|
||||
for (i,vert) in enumerate(marker.vertices)
|
||||
mat[i,1] = vert[1]
|
||||
mat[i,2] = vert[2]
|
||||
end
|
||||
mat[n+1,:] = mat[1,:]
|
||||
pypath.pymember("Path")(mat)
|
||||
# marker.vertices
|
||||
end
|
||||
|
||||
# get the marker shape
|
||||
@ -42,7 +50,7 @@ function getPyPlotMarker(marker::Symbol)
|
||||
marker == :pentagon && return "p"
|
||||
marker == :hexagon && return "h"
|
||||
marker == :octagon && return "8"
|
||||
haskey(_shapes, marker) && return _shapes[marker].vertices
|
||||
haskey(_shapes, marker) && return getPyPlotMarker(_shapes[marker])
|
||||
|
||||
warn("Unknown marker $marker")
|
||||
return "o"
|
||||
@ -218,6 +226,7 @@ function plot!(pkg::PyPlotPackage, plt::Plot; kw...)
|
||||
|
||||
extraargs[:linestyle] = getPyPlotLineStyle(lt, d[:linestyle])
|
||||
extraargs[:marker] = getPyPlotMarker(d[:markershape])
|
||||
dump(extraargs[:marker])
|
||||
|
||||
if lt == :scatter
|
||||
extraargs[:s] = d[:markersize]^2
|
||||
|
||||
@ -157,6 +157,7 @@ function backend()
|
||||
@eval import PyPlot
|
||||
@eval export PyPlot
|
||||
@eval const pycolors = PyPlot.pywrap(PyPlot.pyimport("matplotlib.colors"))
|
||||
@eval const pypath = PyPlot.pywrap(PyPlot.pyimport("matplotlib.path"))
|
||||
# @eval const pycolorbar = PyPlot.pywrap(PyPlot.pyimport("matplotlib.colorbar"))
|
||||
if !isa(Base.Multimedia.displays[end], Base.REPL.REPLDisplay)
|
||||
PyPlot.ioff()
|
||||
|
||||
@ -49,8 +49,9 @@ facts("Gadfly") do
|
||||
# plot(x::AMat, y::AMat; kw...) # multiple lines (one per column of x/y... will assert size(x) == size(y))
|
||||
@fact plot!(rand(10,3), rand(10,3)) --> not(nothing)
|
||||
|
||||
image_comparison_tests(:gadfly, skip=[4,19], eps=img_eps)
|
||||
|
||||
if VERSION >= v"0.4-"
|
||||
image_comparison_tests(:gadfly, skip=[4,19], eps=img_eps)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -58,7 +59,7 @@ if VERSION >= v"0.4-"
|
||||
facts("PyPlot") do
|
||||
@fact pyplot() --> Plots.PyPlotPackage()
|
||||
@fact backend() --> Plots.PyPlotPackage()
|
||||
image_comparison_tests(:pyplot, skip=[19], eps=img_eps)
|
||||
image_comparison_tests(:pyplot, skip=[19,21], eps=img_eps)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||