Skip to content

Commit

Permalink
fix hdf5 and unitful extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Nov 13, 2024
1 parent 731eadb commit ad47d73
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PlotsBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PlotlyJSExt = "PlotlyJS"
PlotlyKaleidoExt = "PlotlyKaleido"
PythonPlotExt = "PythonPlot"
UnicodePlotsExt = "UnicodePlots"
UnitfulExt = ["LaTeXStrings", "Unitful", "UnitfulLatexify"]
UnitfulExt = ["Latexify", "LaTeXStrings", "Unitful", "UnitfulLatexify"]

[compat]
Base64 = "1"
Expand Down
6 changes: 3 additions & 3 deletions PlotsBase/ext/UnitfulExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ function append_unit_if_needed!(attr, key, label::Nothing, u)
end
function append_unit_if_needed!(attr, key, label::S, u) where {S<:AbstractString}
isempty(label) && return attr[key] = UnitfulString(label, u)
if attr[:plot_object].backend == PlotsBase.backend_instance(:pgfplotsx)
attr[key] = UnitfulString(
attr[key] = if attr[:plot_object].backend == PlotsBase.backend_instance(:pgfplotsx)
UnitfulString(
LaTeXString(
format_unit_label(
label,
Expand All @@ -252,7 +252,7 @@ function append_unit_if_needed!(attr, key, label::S, u) where {S<:AbstractString
u,
)
else
attr[key] = UnitfulString(
UnitfulString(
S(
format_unit_label(
label,
Expand Down
5 changes: 3 additions & 2 deletions PlotsBase/src/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,8 @@ const _examples = PlotExample[
"Specifying edges and missing values for barplots",
"In `bar(x, y)`, `x` may be the same length as `y` to specify bar centers, or one longer to specify bar edges.",
:(plot(
bar(-5:5, randn(10)), # bar edges at -5:5
bar(-2:2, [2, -2, NaN, -1, 1], color = 1:5), # bar centers at -2:2, one missing value
bar(-5:5, randn(10)), # bar edges at -5:5
bar(-2:2, [2, -2, NaN, -1, 1], color = 1:5), # bar centers at -2:2, one missing value
legend = false,
)),
),
Expand All @@ -1257,6 +1257,7 @@ const _examples = PlotExample[
_animation_examples = [02, 31]
_backend_skips = Dict(
:none => Int[],
:hdf5 => Int[47],
:pythonplot => Int[],
:gr => Int[],
:plotlyjs => [
Expand Down
5 changes: 4 additions & 1 deletion PlotsBase/src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ macro precompile_backend(backend_package)
if backend_name() :pythonplot
return # FIXME: __init__ failure with PythonPlot
end
$(PlotsBase._examples[i].exprs)
@debug $i
$(PlotsBase._examples[i].exprs)
$i == 1 || return # trigger display only for one example
fn = tempname(scratch_dir)
pl = current()
show(devnull, pl)
if backend_name() :plotlyjs
return # FIXME: precompilation hang
end
if backend_name() :pgfplotsx
return # FIXME: `Colors` extension issue for PFPlotsX
end
Expand Down

0 comments on commit ad47d73

Please sign in to comment.