Skip to content

Commit

Permalink
plot utilities test
Browse files Browse the repository at this point in the history
  • Loading branch information
gp0 committed Mar 24, 2015
1 parent 0f51871 commit 9e3f1f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/BiomolecularStructures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ module BiomolecularStructures
# include sub-modules
include(Pkg.dir("BiomolecularStructures", "src/KABSCH/", "kabsch.jl"))
include(Pkg.dir("BiomolecularStructures", "src/PDB/", "pdb.jl"))
include(Pkg.dir("BiomolecularStructures", "src/PLOT/", "plot.jl"))
end
4 changes: 2 additions & 2 deletions src/PLOT/plot.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module MatrixPlot
using PyPlot
export matrices_plot
export matrices_plot, matrix_prep

# convert a matrix to PyPlot format
function matrix_prep(A::Array{Float64,2})
Expand All @@ -22,7 +22,7 @@ function matrices_plot(P::Array{Float64,2},Q::Array{Float64,2})
pygui(true)
x::Array{Float64,1}, y::Array{Float64,1}, z::Array{Float64,1} = matrix_prep(P)
scatter3D(x, y, z, color="red")
x::Array{Float64,1}, y::Array{Float64,1}, z::Array{Float64,1} = matrix_prep(Q)
x,y,z = matrix_prep(Q)
scatter3D(x, y, z, color="green")
readline()
end
Expand Down
9 changes: 9 additions & 0 deletions test/plot.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using BiomolecularStructures.MatrixPlot

A = [1.0 1.0 1.0; 1.0 1.0 1.0; 1.0 1.0 1.0]

x, y, z = matrix_prep(A)

@test x == [1.0, 1.0, 1.0]
@test y == [1.0, 1.0, 1.0]
@test z == [1.0, 1.0, 1.0]
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Base.Test

include(Pkg.dir("BiomolecularStructures", "test", "kabsch.jl"))
include(Pkg.dir("BiomolecularStructures", "test", "kabsch.jl"))
include(Pkg.dir("BiomolecularStructures", "test", "plot.jl"))

0 comments on commit 9e3f1f5

Please sign in to comment.