From 23ec52c6b4071e5c290cbe2a6d6ff4adfe66ad22 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 13 Aug 2018 00:04:22 -0700 Subject: [PATCH 01/18] Make sure only one colorbar is drawn with GR closes #1642 --- src/backends/gr.jl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 0c2253fe..9e7fbc7a 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1227,16 +1227,18 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) gr_text(GR.wctondc(xi, yi)..., str) end - # draw the colorbar - if cmap && st != :contour # special colorbar with steps is drawn for contours - gr_set_line(1, :solid, yaxis[:foreground_color_axis]) - gr_set_transparency(1) - gr_colorbar(sp, clims) - end - GR.restorestate() end + # draw the colorbar + GR.savestate() + # special colorbar with steps is drawn for contours + if cmap && any(series[:seriestype] != :contour for series in series_list(sp)) + gr_set_line(1, :solid, yaxis[:foreground_color_axis]) + gr_set_transparency(1) + gr_colorbar(sp, clims) + end + GR.restorestate() # add the legend if sp[:legend] != :none From 2acd088226bde5a5ce58358369dfa804a9da8731 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Tue, 14 Aug 2018 20:26:49 -0700 Subject: [PATCH 02/18] Implement colorbar_title for GR --- src/backends/gr.jl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 0c2253fe..0976a8a2 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -27,7 +27,7 @@ const _gr_attr = merge_with_base_supported([ :guidefontfamily, :guidefontsize, :guidefonthalign, :guidefontvalign, :guidefontrotation, :guidefontcolor, :grid, :gridalpha, :gridstyle, :gridlinewidth, - :legend, :legendtitle, :colorbar, + :legend, :legendtitle, :colorbar, :colorbar_title, :fill_z, :line_z, :marker_z, :levels, :ribbon, :quiver, :orientation, @@ -421,6 +421,8 @@ const viewport_plotarea = zeros(4) # the size of the current plot in pixels const gr_plot_size = [600.0, 400.0] +const gr_colorbar_ratio = 0.1 + function gr_viewport_from_bbox(sp::Subplot{GRBackend}, bb::BoundingBox, w, h, viewport_canvas) viewport = zeros(4) viewport[1] = viewport_canvas[2] * (left(bb) / w) @@ -436,7 +438,7 @@ function gr_viewport_from_bbox(sp::Subplot{GRBackend}, bb::BoundingBox, w, h, vi viewport[4] = 0.5 * (vp[3] + vp[4] + extent) end if hascolorbar(sp) - viewport[2] -= 0.1 + viewport[2] -= gr_colorbar_ratio end viewport end @@ -483,6 +485,13 @@ function gr_colorbar(sp::Subplot, clims) GR.cellarray(xmin, xmax, clims[2], clims[1], 1, length(l), l) ztick = 0.5 * GR.tick(clims[1], clims[2]) GR.axes(0, ztick, xmax, clims[1], 0, 1, 0.005) + + gr_set_font(guidefont(sp[:yaxis])) + GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_BOTTOM) + GR.setcharup(-1, 0) + gr_text(viewport_plotarea[2] + gr_colorbar_ratio, + gr_view_ycenter(), sp[:colorbar_title]) + gr_set_viewport_plotarea() end @@ -657,6 +666,9 @@ function _update_min_padding!(sp::Subplot{GRBackend}) if sp[:yaxis][:guide] != "" leftpad += 4mm end + if sp[:colorbar_title] != "" + rightpad += 4mm + end sp.minpad = Tuple(dpi * [leftpad, toppad, rightpad, bottompad]) end From c419f87b6426cab0ab36b196447f952c0d8593c6 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Wed, 15 Aug 2018 23:20:18 +0200 Subject: [PATCH 03/18] update travis script; fix #1658 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89328b76..fb9a97a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ notifications: # uncomment the following lines to override the default test script script: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - julia -e 'using Pkg; Pkg.add(pwd()); Pkg.build("Plots")' + - julia -e 'import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); Pkg.build("Plots")' - julia test/travis_commands.jl # - julia -e 'Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")' # - julia -e 'Pkg.clone("GR"); Pkg.build("GR")' From 87627b8320718704fc5157b7b4605b47d9f4cc1d Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Thu, 16 Aug 2018 11:03:21 +1200 Subject: [PATCH 04/18] Wrap latexstring use in an at-require latexstring comes from the LaTeXStrings package, which is conditionally loaded by pyplot(). Fix #1659. --- src/backends/pyplot.jl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index e6ac252c..d31a2b6e 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -236,16 +236,17 @@ function add_pyfixedformatter(cbar, vals::AVec) cbar[:update_ticks]() end - -function labelfunc(scale::Symbol, backend::PyPlotBackend) - if scale == :log10 - x -> latexstring("10^{$x}") - elseif scale == :log2 - x -> latexstring("2^{$x}") - elseif scale == :ln - x -> latexstring("e^{$x}") - else - string +@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin + function labelfunc(scale::Symbol, backend::PyPlotBackend) + if scale == :log10 + x -> LaTeXStrings.latexstring("10^{$x}") + elseif scale == :log2 + x -> LaTeXStrings.latexstring("2^{$x}") + elseif scale == :ln + x -> LaTeXStrings.latexstring("e^{$x}") + else + string + end end end From 47d8aa871b968b64d8517860cf0e41e2f572fd8f Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Thu, 16 Aug 2018 11:05:39 +1200 Subject: [PATCH 05/18] Do not import latexstring into the global scope It will not be visible to functions in Plots anyway. Instead, labelfunc now explicitly specifies that it uses LaTeXStrings.latexstring. --- src/backends.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends.jl b/src/backends.jl index d6dc3bea..6a5dea31 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -387,7 +387,7 @@ end function _initialize_backend(::PyPlotBackend) @eval Main begin import PyPlot, PyCall - import LaTeXStrings: latexstring + import LaTeXStrings export PyPlot From b56238089cf3985da11574497659045ec881b896 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 15 Aug 2018 21:24:20 -0700 Subject: [PATCH 06/18] Use TEXT_VALIGN_TOP --- src/backends/gr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 0976a8a2..c68ee266 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -487,7 +487,7 @@ function gr_colorbar(sp::Subplot, clims) GR.axes(0, ztick, xmax, clims[1], 0, 1, 0.005) gr_set_font(guidefont(sp[:yaxis])) - GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_BOTTOM) + GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_TOP) GR.setcharup(-1, 0) gr_text(viewport_plotarea[2] + gr_colorbar_ratio, gr_view_ycenter(), sp[:colorbar_title]) From ef63c8d66e68adb56468cf8ac947f92254b3764d Mon Sep 17 00:00:00 2001 From: Andy Nowacki Date: Thu, 16 Aug 2018 15:28:36 +0100 Subject: [PATCH 07/18] Remove broadcasting of getSeriesRGBColor No longer broadcast over d[:seriescolor] when updating series attributes. This fixes #1665, where in Julia v1.0 the PlotUtils ColorGradient type is assumed to be iterable (JuliaLang/julia/#18618). --- src/args.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/args.jl b/src/args.jl index 6b2dd4cd..7e94c0f0 100644 --- a/src/args.jl +++ b/src/args.jl @@ -1563,7 +1563,7 @@ function _update_series_attributes!(d::KW, plt::Plot, sp::Subplot) end # update series color - d[:seriescolor] = getSeriesRGBColor.(d[:seriescolor], Ref(sp), plotIndex) + d[:seriescolor] = getSeriesRGBColor(d[:seriescolor], sp, plotIndex) # update other colors for s in (:line, :marker, :fill) @@ -1577,7 +1577,7 @@ function _update_series_attributes!(d::KW, plt::Plot, sp::Subplot) elseif d[csym] == :match plot_color(d[:seriescolor]) else - getSeriesRGBColor.(d[csym], Ref(sp), plotIndex) + getSeriesRGBColor(d[csym], sp, plotIndex) end end @@ -1585,9 +1585,9 @@ function _update_series_attributes!(d::KW, plt::Plot, sp::Subplot) d[:markerstrokecolor] = if d[:markerstrokecolor] == :match plot_color(sp[:foreground_color_subplot]) elseif d[:markerstrokecolor] == :auto - getSeriesRGBColor.(d[:markercolor], Ref(sp), plotIndex) + getSeriesRGBColor(d[:markercolor], sp, plotIndex) else - getSeriesRGBColor.(d[:markerstrokecolor], Ref(sp), plotIndex) + getSeriesRGBColor(d[:markerstrokecolor], sp, plotIndex) end # if marker_z, fill_z or line_z are set, ensure we have a gradient From b2c4561a7d511d9b6e10d8b01edd4655b6b5c97d Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Fri, 17 Aug 2018 10:49:57 +0200 Subject: [PATCH 08/18] gr: round to UInt not Int Fixes an error with 32-bit system compatibility --- src/backends/gr.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 0c2253fe..720e52a5 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1103,10 +1103,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) GR.setspace(zmin, zmax, 0, 90) grad = isa(series[:fillcolor], ColorGradient) ? series[:fillcolor] : cgrad() colors = [plot_color(grad[clamp((zi-zmin) / (zmax-zmin), 0, 1)], series[:fillalpha]) for zi=z] - rgba = map(c -> UInt32( round(Int, alpha(c) * 255) << 24 + - round(Int, blue(c) * 255) << 16 + - round(Int, green(c) * 255) << 8 + - round(Int, red(c) * 255) ), colors) + rgba = map(c -> UInt32( round(UInt, alpha(c) * 255) << 24 + + round(UInt, blue(c) * 255) << 16 + + round(UInt, green(c) * 255) << 8 + + round(UInt, red(c) * 255) ), colors) w, h = length(x), length(y) GR.drawimage(xmin, xmax, ymax, ymin, w, h, rgba) @@ -1210,12 +1210,12 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) xmin, xmax = ignorenan_extrema(series[:x]); ymin, ymax = ignorenan_extrema(series[:y]) if eltype(z) <: Colors.AbstractGray grey = round.(UInt8, float(z) * 255) - rgba = map(c -> UInt32( 0xff000000 + Int(c)<<16 + Int(c)<<8 + Int(c) ), grey) + rgba = map(c -> UInt32( 0xff000000 + UInt(c)<<16 + UInt(c)<<8 + UInt(c) ), grey) else - rgba = map(c -> UInt32( round(Int, alpha(c) * 255) << 24 + - round(Int, blue(c) * 255) << 16 + - round(Int, green(c) * 255) << 8 + - round(Int, red(c) * 255) ), z) + rgba = map(c -> UInt32( round(UInt, alpha(c) * 255) << 24 + + round(UInt, blue(c) * 255) << 16 + + round(UInt, green(c) * 255) << 8 + + round(UInt, red(c) * 255) ), z) end GR.drawimage(xmin, xmax, ymax, ymin, w, h, rgba) end From cf1a0e3c33c894a78f2e5c7f9644d90048a60e21 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Fri, 17 Aug 2018 11:19:57 +0200 Subject: [PATCH 09/18] Add vector function for rgb --- src/args.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/args.jl b/src/args.jl index 7e94c0f0..c512cb71 100644 --- a/src/args.jl +++ b/src/args.jl @@ -1521,6 +1521,11 @@ function getSeriesRGBColor(c, sp::Subplot, n::Int) plot_color(c) end +function getSeriesRGBColor(c::AbstractArray, sp::Subplot, n::Int) + @info "it is surprising that this function is called - please report a use case as a Plots issue" + map(x->getSeriesRGBColor(x, sp, n), c) +end + function ensure_gradient!(d::KW, csym::Symbol, asym::Symbol) if !isa(d[csym], ColorGradient) d[csym] = typeof(d[asym]) <: AbstractVector ? cgrad() : cgrad(alpha = d[asym]) From 71131fd00c25bd7554b03bbc0938de791ba6fb2a Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Sat, 18 Aug 2018 23:24:14 +0200 Subject: [PATCH 10/18] make plotattr work again --- src/plotattr.jl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plotattr.jl b/src/plotattr.jl index 42e3edf5..e1733984 100644 --- a/src/plotattr.jl +++ b/src/plotattr.jl @@ -40,6 +40,9 @@ function plotattr(attribute::AbstractString) error("There is no attribute named $attribute") end +printnothing(x) = x +printnothing(x::Nothing) = "nothing" + function plotattr(attrtype::Symbol, attribute::AbstractString) in(attrtype, keys(_attribute_defaults)) || ArgumentError("`attrtype` must match one of $(attrtypes())") @@ -49,14 +52,14 @@ function plotattr(attrtype::Symbol, attribute::AbstractString) first_period_idx = findfirst(isequal('.'), desc) typedesc = desc[1:first_period_idx-1] desc = strip(desc[first_period_idx+1:end]) - als = keys(filter((_,v)->v==attribute, _keyAliases)) |> collect |> sort + als = keys(filter(x->x[2]==attribute, _keyAliases)) |> collect |> sort als = join(map(string,als), ", ") def = _attribute_defaults[attrtype][attribute] # Looks up the different elements and plots them - println("$attribute ", typedesc == "" ? "" : "{$typedesc}", "\n", - als == "" ? "" : "$als\n", - "\n$desc\n", - "$(attrtype) attribute, ", def == "" ? "" : " default: $def") + println("$(printnothing(attribute)) ", typedesc == "" ? "" : "{$(printnothing(typedesc))}", "\n", + als == "" ? "" : "$(printnothing(als))\n", + "\n$(printnothing(desc))\n", + "$(printnothing(attrtype)) attribute, ", def == "" ? "" : " default: $(printnothing(def))") end From 905accdb7dfd6a0f3cad4e81d5d15569195f245a Mon Sep 17 00:00:00 2001 From: improbable22 <29553230+improbable22@users.noreply.github.com> Date: Sun, 19 Aug 2018 07:20:17 +0200 Subject: [PATCH 11/18] Remove P2 & P3 from export As in #1675, important stuff! --- src/Plots.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 1b73de24..2b96c5cb 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -104,8 +104,6 @@ export rotate, rotate!, center, - P2, - P3, BezierCurve, plotattr From 7c505949fc58a08887d339070751410f29c5ce9b Mon Sep 17 00:00:00 2001 From: djsegal Date: Sun, 19 Aug 2018 02:25:04 -0400 Subject: [PATCH 12/18] =?UTF-8?q?Add=20=E2=80=9Ccolorbar=5Ftitle=E2=80=9D?= =?UTF-8?q?=20to=20pgfplots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backends/pgfplots.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/pgfplots.jl b/src/backends/pgfplots.jl index 153331d8..be3218df 100644 --- a/src/backends/pgfplots.jl +++ b/src/backends/pgfplots.jl @@ -23,7 +23,7 @@ const _pgfplots_attr = merge_with_base_supported([ :guide, :lims, :ticks, :scale, :flip, :rotation, :tickfont, :guidefont, :legendfont, :grid, :legend, - :colorbar, + :colorbar, :colorbar_title, :fill_z, :line_z, :marker_z, :levels, # :ribbon, :quiver, :arrow, # :orientation, @@ -550,6 +550,7 @@ function _update_plot_object(plt::Plot{PGFPlotsBackend}) end @label colorbar_end + push!(style, "colorbar style={title=$(sp[:colorbar_title])}") o = axisf(; style = join(style, ","), kw...) # add the series object to the PGFPlots.Axis From 45dc9e5c0d1640b7e0c90da4f7aebd01561e21ee Mon Sep 17 00:00:00 2001 From: SebastianM-C <31181429+SebastianM-C@users.noreply.github.com> Date: Mon, 7 May 2018 22:24:07 +0300 Subject: [PATCH 13/18] Add 2D marker_z with Functions --- src/pipeline.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipeline.jl b/src/pipeline.jl index bca77623..110a29bc 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -117,7 +117,7 @@ function _preprocess_userrecipe(kw::KW) # map marker_z if it's a Function if isa(get(kw, :marker_z, nothing), Function) # TODO: should this take y and/or z as arguments? - kw[:marker_z] = map(kw[:marker_z], kw[:x], kw[:y], kw[:z]) + kw[:marker_z] = isa(kw[:z], Void) ? map(kw[:marker_z], kw[:x], kw[:y]) : map(kw[:marker_z], kw[:x], kw[:y], kw[:z]) end # map line_z if it's a Function From 92b0d5c0be70a41530ac6b35384d4e5d7c67d48a Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 18 Aug 2018 16:48:02 +0300 Subject: [PATCH 14/18] Add line_z and update arg_desc.jl --- src/arg_desc.jl | 4 ++-- src/pipeline.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arg_desc.jl b/src/arg_desc.jl index afccd2e6..eecf39db 100644 --- a/src/arg_desc.jl +++ b/src/arg_desc.jl @@ -27,8 +27,8 @@ const _arg_desc = KW( :x => "Various. Input data. First Dimension", :y => "Various. Input data. Second Dimension", :z => "Various. Input data. Third Dimension. May be wrapped by a `Surface` for surface and heatmap types.", -:marker_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or nothing. z-values for each series data point, which correspond to the color to be used from a markercolor gradient.", -:line_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or nothing. z-values for each series line segment, which correspond to the color to be used from a linecolor gradient. Note that for N points, only the first N-1 values are used (one per line-segment).", +:marker_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or Function `f(x,y) -> z_value`, or nothing. z-values for each series data point, which correspond to the color to be used from a markercolor gradient.", +:line_z => "AbstractVector, Function `f(x,y,z) -> z_value`, or Function `f(x,y) -> z_value`, or nothing. z-values for each series line segment, which correspond to the color to be used from a linecolor gradient. Note that for N points, only the first N-1 values are used (one per line-segment).", :fill_z => "Matrix{Float64} of the same size as z matrix, which specifies the color of the 3D surface; the default value is `nothing`.", :levels => "Integer, NTuple{2,Integer}. Number of levels (or x-levels/y-levels) for a contour type.", :orientation => "Symbol. Horizontal or vertical orientation for bar types. Values `:h`, `:hor`, `:horizontal` correspond to horizontal (sideways, anchored to y-axis), and `:v`, `:vert`, and `:vertical` correspond to vertical (the default).", diff --git a/src/pipeline.jl b/src/pipeline.jl index 110a29bc..5c1772db 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -117,12 +117,12 @@ function _preprocess_userrecipe(kw::KW) # map marker_z if it's a Function if isa(get(kw, :marker_z, nothing), Function) # TODO: should this take y and/or z as arguments? - kw[:marker_z] = isa(kw[:z], Void) ? map(kw[:marker_z], kw[:x], kw[:y]) : map(kw[:marker_z], kw[:x], kw[:y], kw[:z]) + kw[:marker_z] = isa(kw[:z], Nothing) ? map(kw[:marker_z], kw[:x], kw[:y]) : map(kw[:marker_z], kw[:x], kw[:y], kw[:z]) end # map line_z if it's a Function if isa(get(kw, :line_z, nothing), Function) - kw[:line_z] = map(kw[:line_z], kw[:x], kw[:y], kw[:z]) + kw[:line_z] = isa(kw[:z], Nothing) ? map(kw[:line_z], kw[:x], kw[:y]) : map(kw[:line_z], kw[:x], kw[:y], kw[:z]) end # convert a ribbon into a fillrange From c005cc211f4e8139fdf09ec3f4eee9401781b7c6 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 19 Aug 2018 14:23:26 +0300 Subject: [PATCH 15/18] Add example --- src/examples.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples.jl b/src/examples.jl index ee362741..71c41a8c 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -427,7 +427,7 @@ each line segment or marker in the plot. x = t .* cos.(θ) y = t .* sin.(θ) p1 = plot(x, y, line_z=t, linewidth=3, legend=false) - p2 = scatter(x, y, marker_z=t, color=:bluesreds, legend=false) + p2 = scatter(x, y, marker_z=(x,y)->x+y, color=:bluesreds, legend=false) plot(p1, p2) end)] ), From b551f6714b9fc05018f0cd4bf1bdf0ad9efa03c8 Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Sun, 19 Aug 2018 15:49:05 +0200 Subject: [PATCH 16/18] Replace link to docs with docs badge --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 65116717..1b741816 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.org/JuliaPlots/Plots.jl.svg?branch=master)](https://travis-ci.org/JuliaPlots/Plots.jl) [![Build status](https://ci.appveyor.com/api/projects/status/github/juliaplots/plots.jl?branch=master&svg=true)](https://ci.appveyor.com/project/mkborregaard/plots-jl) [![Join the chat at https://gitter.im/tbreloff/Plots.jl](https://badges.gitter.im/tbreloff/Plots.jl.svg)](https://gitter.im/tbreloff/Plots.jl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![][https://img.shields.io/badge/docs-latest-blue.svg]][http://docs.juliaplots.org/latest] @@ -21,5 +22,3 @@ Plots is a plotting API and toolset. My goals with the package are: - **Consistent**. Don't commit to one graphics package, use the same code everywhere. - **Lightweight**. Very few dependencies. - **Smart**. Attempts to figure out what you **want** it to do... not just what you **tell** it. - -View the [full documentation](http://docs.juliaplots.org/latest). From 3c96831cdcf57b52df6bc8fcc13fc9b7ab8cc08b Mon Sep 17 00:00:00 2001 From: Michael Krabbe Borregaard Date: Sun, 19 Aug 2018 15:53:36 +0200 Subject: [PATCH 17/18] fix_1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b741816..955a5f4b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](https://travis-ci.org/JuliaPlots/Plots.jl.svg?branch=master)](https://travis-ci.org/JuliaPlots/Plots.jl) [![Build status](https://ci.appveyor.com/api/projects/status/github/juliaplots/plots.jl?branch=master&svg=true)](https://ci.appveyor.com/project/mkborregaard/plots-jl) [![Join the chat at https://gitter.im/tbreloff/Plots.jl](https://badges.gitter.im/tbreloff/Plots.jl.svg)](https://gitter.im/tbreloff/Plots.jl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![][https://img.shields.io/badge/docs-latest-blue.svg]][http://docs.juliaplots.org/latest] +Latest documentation From fcaae346a7c3d084d5674bc7a4409f3a54ce6db2 Mon Sep 17 00:00:00 2001 From: Pietro Vertechi Date: Tue, 21 Aug 2018 18:17:47 +0100 Subject: [PATCH 18/18] Fix NamedTuple integration --- src/args.jl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/args.jl b/src/args.jl index c512cb71..199a9a46 100644 --- a/src/args.jl +++ b/src/args.jl @@ -1086,16 +1086,13 @@ function extractGroupArgs(vs::Tuple, args...) end # allow passing NamedTuples for a named legend entry -@require NamedTuples = "73a701b4-84e1-5df0-88ff-1968ee2ee8dc" begin - legendEntryFromTuple(ns::NamedTuples.NamedTuple) = - join(["$k = $v" for (k, v) in zip(keys(ns), values(ns))], ", ") +legendEntryFromTuple(ns::NamedTuple) = + join(["$k = $v" for (k, v) in pairs(ns)], ", ") - function extractGroupArgs(vs::NamedTuples.NamedTuple, args...) - isempty(vs) && return GroupBy([""], [1:size(args[1],1)]) - NT = eval(:(NamedTuples.@NT($(keys(vs)...)))){map(eltype, vs)...} - v = map(NT, vs...) - extractGroupArgs(v, args...; legendEntry = legendEntryFromTuple) - end +function extractGroupArgs(vs::NamedTuple, args...) + isempty(vs) && return GroupBy([""], [1:size(args[1],1)]) + v = map(NamedTuple{keys(vs)}∘tuple, values(vs)...) + extractGroupArgs(v, args...; legendEntry = legendEntryFromTuple) end # expecting a mapping of "group label" to "group indices"