diff --git a/docs/example_generation.jl b/docs/example_generation.jl index 6d98a251..37cdc050 100644 --- a/docs/example_generation.jl +++ b/docs/example_generation.jl @@ -31,7 +31,7 @@ const examples = PlotExample[ [ :(p = plot([sin,cos], zeros(0), leg=false)), :(anim = Animation()), - :(for x in linspace(0, 10π, 200) + :(for x in linspace(0, 10π, 100) push!(p, x, Float64[sin(x), cos(x)]) frame(anim) end) @@ -63,7 +63,8 @@ const examples = PlotExample[ PlotExample("Arguments", "Plot multiple series with different numbers of points. Mix arguments that apply to all series (marker/markersize) with arguments unique to each series (colors). Special arguments `line`, `marker`, and `fill` will automatically figure out what arguments to set (for example, we are setting the `linestyle`, `linewidth`, and `color` arguments with `line`.) Note that we pass a matrix of colors, and this applies the colors to each series.", [ - :(plot(Vector[rand(10), rand(20)], marker=(:ellipse,8), line=(:dot,3,[:black :orange]))) + :(ys = Vector[rand(10), rand(20)]), + :(plot(ys, line=(:dot,4,[:black :orange]), marker=([:hex :d],12,0.8,stroke(3,:gray)))) ]), PlotExample("Build plot in pieces", "Start with a base plot...", diff --git a/src/backends/gadfly.jl b/src/backends/gadfly.jl index 31987566..166a7162 100644 --- a/src/backends/gadfly.jl +++ b/src/backends/gadfly.jl @@ -140,10 +140,18 @@ function getGadflyMarkerTheme(d::Dict, plotargs::Dict) c = RGBA(RGB(c), α) end + ms = d[:markersize] + ms = if typeof(ms) <: AVec + warn("Gadfly doesn't support variable marker sizes... using the average: $(mean(ms))") + mean(ms) * Gadfly.px + else + ms * Gadfly.px + end + # fg = getColor(plotargs[:foreground_color]) Gadfly.Theme(; default_color = c, - default_point_size = d[:markersize] * Gadfly.px, + default_point_size = ms, discrete_highlight_color = c -> RGB(getColor(d[:markerstrokecolor])), highlight_width = d[:markerstrokewidth] * Gadfly.px, # get_extra_theme_args(d, :markerstrokestyle)... diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 9193f3ea..e696ae4b 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -56,9 +56,9 @@ end function compareToReferenceImage(tmpfn, reffn) println("here000") # @eval import Gtk - Gtk.gtk_main() + # Gtk.gtk_main() println("huh0") - sleep(2) + # sleep(2) # add the images imgbox = Gtk.GtkBoxLeaf(:h) @@ -85,12 +85,12 @@ function compareToReferenceImage(tmpfn, reffn) println("here01") - ################ - # TODO: remove this when it's fixed in Gtk... see http://stackoverflow.com/questions/33549485/julia-gtk-windows-do-not-display-outside-repl - signal_connect(win, :destroy) do widget - Gtk.gtk_quit() - end - ################ + # ################ + # # TODO: remove this when it's fixed in Gtk... see http://stackoverflow.com/questions/33549485/julia-gtk-windows-do-not-display-outside-repl + # signal_connect(win, :destroy) do widget + # Gtk.gtk_quit() + # end + # ################ println("here02") showall(win) diff --git a/test/refimg/gadfly/ref10.png b/test/refimg/gadfly/ref10.png index e7138377..2e9c1a9e 100644 Binary files a/test/refimg/gadfly/ref10.png and b/test/refimg/gadfly/ref10.png differ diff --git a/test/refimg/gadfly/ref11.png b/test/refimg/gadfly/ref11.png index 38bf6f96..7e87bd24 100644 Binary files a/test/refimg/gadfly/ref11.png and b/test/refimg/gadfly/ref11.png differ diff --git a/test/refimg/gadfly/ref15.png b/test/refimg/gadfly/ref15.png index ea2cb739..785bea7a 100644 Binary files a/test/refimg/gadfly/ref15.png and b/test/refimg/gadfly/ref15.png differ diff --git a/test/refimg/gadfly/ref21.png b/test/refimg/gadfly/ref21.png index e1f3116b..ebe2e280 100644 Binary files a/test/refimg/gadfly/ref21.png and b/test/refimg/gadfly/ref21.png differ diff --git a/test/refimg/gadfly/ref4.png b/test/refimg/gadfly/ref4.png index 1ade3079..172fb6f1 100644 Binary files a/test/refimg/gadfly/ref4.png and b/test/refimg/gadfly/ref4.png differ diff --git a/test/refimg/gadfly/ref7.png b/test/refimg/gadfly/ref7.png index 423b9e87..ab40d9fb 100644 Binary files a/test/refimg/gadfly/ref7.png and b/test/refimg/gadfly/ref7.png differ diff --git a/test/refimg/pyplot/ref10.png b/test/refimg/pyplot/ref10.png index fe3dac4d..a6825f72 100644 Binary files a/test/refimg/pyplot/ref10.png and b/test/refimg/pyplot/ref10.png differ diff --git a/test/refimg/pyplot/ref11.png b/test/refimg/pyplot/ref11.png index 17848bde..76585bf9 100644 Binary files a/test/refimg/pyplot/ref11.png and b/test/refimg/pyplot/ref11.png differ diff --git a/test/refimg/pyplot/ref13.png b/test/refimg/pyplot/ref13.png index 63114863..8bd13c69 100644 Binary files a/test/refimg/pyplot/ref13.png and b/test/refimg/pyplot/ref13.png differ diff --git a/test/refimg/pyplot/ref15.png b/test/refimg/pyplot/ref15.png index 49cc7c29..48496bb8 100644 Binary files a/test/refimg/pyplot/ref15.png and b/test/refimg/pyplot/ref15.png differ diff --git a/test/refimg/pyplot/ref16.png b/test/refimg/pyplot/ref16.png index bf6e5720..f4f15ceb 100644 Binary files a/test/refimg/pyplot/ref16.png and b/test/refimg/pyplot/ref16.png differ diff --git a/test/refimg/pyplot/ref21.png b/test/refimg/pyplot/ref21.png index 93d56702..d7bcd812 100644 Binary files a/test/refimg/pyplot/ref21.png and b/test/refimg/pyplot/ref21.png differ diff --git a/test/refimg/pyplot/ref4.png b/test/refimg/pyplot/ref4.png index f2568ed8..205ca829 100644 Binary files a/test/refimg/pyplot/ref4.png and b/test/refimg/pyplot/ref4.png differ diff --git a/test/refimg/pyplot/ref7.png b/test/refimg/pyplot/ref7.png index f18616d2..04653f98 100644 Binary files a/test/refimg/pyplot/ref7.png and b/test/refimg/pyplot/ref7.png differ diff --git a/test/refimg/pyplot/ref9.png b/test/refimg/pyplot/ref9.png index 38218b49..915824eb 100644 Binary files a/test/refimg/pyplot/ref9.png and b/test/refimg/pyplot/ref9.png differ