Merge pull request #894 from mkborregaard/legendtitle_example

Adds legendtitle to example 12
This commit is contained in:
Michael Krabbe Borregaard 2017-06-07 23:54:39 +02:00 committed by GitHub
commit 4ce35ef352
3 changed files with 20 additions and 21 deletions

View File

@ -119,7 +119,7 @@ PlotExample("Line styles",
styles = reshape(styles, 1, length(styles)) # Julia 0.6 unfortunately gives an error when transposing symbol vectors styles = reshape(styles, 1, length(styles)) # Julia 0.6 unfortunately gives an error when transposing symbol vectors
n = length(styles) n = length(styles)
y = cumsum(randn(20,n),1) y = cumsum(randn(20,n),1)
plot(y, line = (5, styles), label = map(string,styles)) plot(y, line = (5, styles), label = map(string,styles), legendtitle = "linestyle")
end)] end)]
), ),

View File

@ -13,7 +13,7 @@ try
end end
# using Plots # reexported by StatPlots using Plots
using StatPlots using StatPlots
using FactCheck using FactCheck
using Glob using Glob

View File

@ -7,19 +7,6 @@ srand(1234)
default(show=false, reuse=true) default(show=false, reuse=true)
img_eps = isinteractive() ? 1e-2 : 10e-2 img_eps = isinteractive() ? 1e-2 : 10e-2
# facts("Gadfly") do
# @fact gadfly() --> Plots.GadflyBackend()
# @fact backend() --> Plots.GadflyBackend()
#
# @fact typeof(plot(1:10)) --> Plots.Plot{Plots.GadflyBackend}
# @fact plot(Int[1,2,3], rand(3)) --> not(nothing)
# @fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing)
# @fact plot!(rand(10,3), rand(10,3)) --> not(nothing)
#
# image_comparison_facts(:gadfly, skip=[4,6,23,24,27], eps=img_eps)
# end
facts("GR") do facts("GR") do
@fact gr() --> Plots.GRBackend() @fact gr() --> Plots.GRBackend()
@fact backend() --> Plots.GRBackend() @fact backend() --> Plots.GRBackend()
@ -35,6 +22,13 @@ facts("PyPlot") do
image_comparison_facts(:pyplot, eps=img_eps) image_comparison_facts(:pyplot, eps=img_eps)
end end
facts("UnicodePlots") do
@fact unicodeplots() --> Plots.UnicodePlotsBackend()
@fact backend() --> Plots.UnicodePlotsBackend()
# lets just make sure it runs without error
@fact isa(plot(rand(10)), Plots.Plot) --> true
end
# The plotlyjs testimages return a connection error on travis: # The plotlyjs testimages return a connection error on travis:
# connect: connection refused (ECONNREFUSED) # connect: connection refused (ECONNREFUSED)
@ -105,13 +99,18 @@ end
# end # end
facts("UnicodePlots") do # facts("Gadfly") do
@fact unicodeplots() --> Plots.UnicodePlotsBackend() # @fact gadfly() --> Plots.GadflyBackend()
@fact backend() --> Plots.UnicodePlotsBackend() # @fact backend() --> Plots.GadflyBackend()
#
# @fact typeof(plot(1:10)) --> Plots.Plot{Plots.GadflyBackend}
# @fact plot(Int[1,2,3], rand(3)) --> not(nothing)
# @fact plot(sort(rand(10)), rand(Int, 10, 3)) --> not(nothing)
# @fact plot!(rand(10,3), rand(10,3)) --> not(nothing)
#
# image_comparison_facts(:gadfly, skip=[4,6,23,24,27], eps=img_eps)
# end
# lets just make sure it runs without error
@fact isa(plot(rand(10)), Plots.Plot) --> true
end