Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d3604ed80 | |||
| 574f93208f | |||
| 3b082f88d1 | |||
| 95f91e18f9 | |||
| 1be0b76940 | |||
| 2b4cd34377 | |||
| ab820a5b76 |
+1
-1
@@ -1,7 +1,7 @@
|
||||
name = "Plots"
|
||||
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
author = ["Tom Breloff (@tbreloff)"]
|
||||
version = "1.6.7"
|
||||
version = "1.6.5"
|
||||
|
||||
[deps]
|
||||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
|
||||
+3
-3
@@ -367,10 +367,10 @@ is_marker_supported(::GRBackend, shape::Shape) = true
|
||||
function _initialize_backend(pkg::PlotlyBackend)
|
||||
try
|
||||
@eval Main begin
|
||||
import PlotlyBase
|
||||
import ORCA
|
||||
end
|
||||
catch
|
||||
@info "For saving to png with the Plotly backend PlotlyBase has to be installed."
|
||||
@info "For saving to png with the Plotly backend ORCA has to be installed."
|
||||
end
|
||||
end
|
||||
|
||||
@@ -488,7 +488,7 @@ const _pgfplots_scale = [:identity, :ln, :log2, :log10]
|
||||
|
||||
function _initialize_backend(pkg::PlotlyJSBackend)
|
||||
@eval Main begin
|
||||
import PlotlyJS
|
||||
import PlotlyJS, ORCA
|
||||
export PlotlyJS
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1332,8 +1332,6 @@ function gr_label_ticks(sp, letter, ticks)
|
||||
end
|
||||
end
|
||||
|
||||
function gr_label_ticks(sp, letter, ticks::Nothing) end
|
||||
|
||||
function gr_label_ticks_3d(sp, letter, ticks)
|
||||
near_letter = letter in (:x, :z) ? :y : :x
|
||||
far_letter = letter in (:x, :y) ? :z : :x
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
function plotlybase_syncplot(plt::Plot)
|
||||
plt.o = PlotlyBase.Plot()
|
||||
traces = PlotlyBase.GenericTrace[]
|
||||
plt.o = ORCA.PlotlyBase.Plot()
|
||||
traces = ORCA.PlotlyBase.GenericTrace[]
|
||||
for series_dict in plotly_series(plt)
|
||||
plotly_type = pop!(series_dict, :type)
|
||||
push!(traces, PlotlyBase.GenericTrace(plotly_type; series_dict...))
|
||||
push!(traces, ORCA.PlotlyBase.GenericTrace(plotly_type; series_dict...))
|
||||
end
|
||||
PlotlyBase.addtraces!(plt.o, traces...)
|
||||
ORCA.PlotlyBase.addtraces!(plt.o, traces...)
|
||||
layout = plotly_layout(plt)
|
||||
w, h = plt[:size]
|
||||
PlotlyBase.relayout!(plt.o, layout, width = w, height = h)
|
||||
ORCA.PlotlyBase.relayout!(plt.o, layout, width = w, height = h)
|
||||
return plt.o
|
||||
end
|
||||
|
||||
@@ -19,5 +19,5 @@ for (mime, fmt) in (
|
||||
"image/eps" => "eps",
|
||||
)
|
||||
@eval _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PlotlyBackend}) =
|
||||
PlotlyBase.savefig(io, plotlybase_syncplot(plt), format = $fmt)
|
||||
ORCA.PlotlyBase.savefig(io, plotlybase_syncplot(plt), format = $fmt)
|
||||
end
|
||||
@@ -788,7 +788,8 @@ function plotly_series_segments(series::Series, plotattributes_base::KW, x, y, z
|
||||
else
|
||||
# if fillrange is a tuple with upper and lower limit, plotattributes_out_fillrange
|
||||
# is the series that will do the filling
|
||||
plotattributes_out_fillrange[:x], plotattributes_out_fillrange[:y] = concatenate_fillrange(x[rng], series[:fillrange])
|
||||
fillrng = Tuple(series[:fillrange][i][rng] for i in 1:2)
|
||||
plotattributes_out_fillrange[:x], plotattributes_out_fillrange[:y] = concatenate_fillrange(x[rng], fillrng)
|
||||
plotattributes_out_fillrange[:line][:width] = 0
|
||||
delete!(plotattributes_out, :fill)
|
||||
delete!(plotattributes_out, :fillcolor)
|
||||
|
||||
+2
-2
@@ -41,8 +41,8 @@ function __init__()
|
||||
include(fn)
|
||||
end
|
||||
|
||||
@require PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" begin
|
||||
fn = joinpath(@__DIR__, "backends", "plotlybase.jl")
|
||||
@require ORCA = "47be7bcc-f1a6-5447-8b36-7eeeff7534fd" begin
|
||||
fn = joinpath(@__DIR__, "backends", "orca.jl")
|
||||
include(fn)
|
||||
end
|
||||
|
||||
|
||||
+1
-28
@@ -262,22 +262,13 @@ end
|
||||
end
|
||||
end
|
||||
newx, newy = zeros(3n), zeros(3n)
|
||||
newz = z!== nothing ? zeros(3n) : nothing
|
||||
for i = 1:n
|
||||
rng = (3i - 2):(3i)
|
||||
newx[rng] = [x[i], x[i], NaN]
|
||||
if z !== nothing
|
||||
newy[rng] = [y[i], y[i], NaN]
|
||||
newz[rng] = [_cycle(fr, i), z[i], NaN]
|
||||
else
|
||||
newy[rng] = [_cycle(fr, i), y[i], NaN]
|
||||
end
|
||||
newy[rng] = [_cycle(fr, i), y[i], NaN]
|
||||
end
|
||||
x := newx
|
||||
y := newy
|
||||
if z !== nothing
|
||||
z := newz
|
||||
end
|
||||
fillrange := nothing
|
||||
seriestype := :path
|
||||
|
||||
@@ -287,9 +278,6 @@ end
|
||||
seriestype := :scatter
|
||||
x := x
|
||||
y := y
|
||||
if z !== nothing
|
||||
z := z
|
||||
end
|
||||
label := ""
|
||||
primary := false
|
||||
()
|
||||
@@ -1101,12 +1089,6 @@ function error_coords(errorbar, errordata, otherdata...)
|
||||
return (ed, od...)
|
||||
end
|
||||
|
||||
# clamp non-NaN values in an array to Base.eps(Float64) for log-scale plots
|
||||
function clamp_to_eps!(ary)
|
||||
replace!(x -> x <= 0.0 ? Base.eps(Float64) : x, ary)
|
||||
nothing
|
||||
end
|
||||
|
||||
# we will create a series of path segments, where each point represents one
|
||||
# side of an errorbar
|
||||
|
||||
@@ -1120,9 +1102,6 @@ end
|
||||
plotattributes[:x], plotattributes[:y], plotattributes[:z] =
|
||||
error_coords(xerr, x, y, z)
|
||||
end
|
||||
if :xscale ∈ keys(plotattributes) && plotattributes[:xscale] == :log10
|
||||
clamp_to_eps!(plotattributes[:x])
|
||||
end
|
||||
()
|
||||
end
|
||||
@deps xerror path
|
||||
@@ -1137,9 +1116,6 @@ end
|
||||
plotattributes[:y], plotattributes[:x], plotattributes[:z] =
|
||||
error_coords(yerr, y, x, z)
|
||||
end
|
||||
if :yscale ∈ keys(plotattributes) && plotattributes[:yscale] == :log10
|
||||
clamp_to_eps!(plotattributes[:y])
|
||||
end
|
||||
()
|
||||
end
|
||||
@deps yerror path
|
||||
@@ -1152,9 +1128,6 @@ end
|
||||
plotattributes[:z], plotattributes[:x], plotattributes[:y] =
|
||||
error_coords(zerr, z, x, y)
|
||||
end
|
||||
if :zscale ∈ keys(plotattributes) && plotattributes[:zscale] == :log10
|
||||
clamp_to_eps!(plotattributes[:z])
|
||||
end
|
||||
()
|
||||
end
|
||||
@deps zerror path
|
||||
|
||||
Reference in New Issue
Block a user