Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60b8b0080c | |||
| b30ff9b41b | |||
| cf1a0e3c33 | |||
| e94fe13178 | |||
| b2c4561a7d | |||
| ef63c8d66e | |||
| 1697b99bbc | |||
| c419f87b64 | |||
| 9ae22a1ad7 | |||
| b4dfd35be6 |
@@ -5,3 +5,4 @@
|
||||
examples/.ipynb_checkpoints/*
|
||||
examples/meetup/.ipynb_checkpoints/*
|
||||
deps/plotly-latest.min.js
|
||||
deps/build.log
|
||||
|
||||
+1
-1
@@ -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")'
|
||||
|
||||
+9
-4
@@ -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])
|
||||
@@ -1563,7 +1568,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 +1582,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 +1590,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
|
||||
|
||||
+9
-9
@@ -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
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ function __init__()
|
||||
include(joinpath(@__DIR__, "backends", "gr.jl"))
|
||||
include(joinpath(@__DIR__, "backends", "web.jl"))
|
||||
|
||||
@require GLVisualize = "4086de5b-f4b6-55f3-abb0-b8c73827585f" include(joinpath(@__DIR__, "backends", "gr.jl"))
|
||||
@require GLVisualize = "4086de5b-f4b6-55f3-abb0-b8c73827585f" include(joinpath(@__DIR__, "backends", "glvisualize.jl"))
|
||||
@require HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" include(joinpath(@__DIR__, "backends", "hdf5.jl"))
|
||||
@require InspectDR = "d0351b0e-4b05-5898-87b3-e2a8edfddd1d" include(joinpath(@__DIR__, "backends", "inspectdr.jl"))
|
||||
@require PGFPlots = "3b7a836e-365b-5785-a47d-02c71176b4aa" include(joinpath(@__DIR__, "backends", "pgfplots.jl"))
|
||||
|
||||
Reference in New Issue
Block a user