Hdf5plot_write error

Trying to write a plot in hdf5 format yields the following error:

using Plots, HDF5

julia> hdf5()
Plots.HDF5Backend()

julia> p=plot(1:10, 1:10);

julia> Plots.hdf5plot_write(p, "plotsave.hdf5")
ERROR: MethodError: no method matching _hdf5plot_write(::HDF5Group, ::Plots.Attr)
Closest candidates are:
  _hdf5plot_write(::Any, ::Dict) at /Users/lutz/.julia/packages/Plots/12uaJ/src/backends/hdf5.jl:380
  _hdf5plot_write(::Plots.Plot{Plots.HDF5Backend}, ::Any) at /Users/lutz/.julia/packages/Plots/12uaJ/src/backends/hdf5.jl:405
Stacktrace:
 [1] _hdf5plot_write(::Plots.Plot{Plots.HDF5Backend}, ::HDF5File) at /Users/lutz/.julia/packages/Plots/12uaJ/src/backends/hdf5.jl:408
 [2] (::Plots.var"#534#535"{Plots.Plot{Plots.HDF5Backend}})(::HDF5File) at /Users/lutz/.julia/packages/Plots/12uaJ/src/backends/hdf5.jl:421
 [3] #h5open#5(::Bool, ::typeof(h5open), ::Plots.var"#534#535"{Plots.Plot{Plots.HDF5Backend}}, ::String, ::Vararg{String,N} where N) at /Users/lutz/.julia/packages/HDF5/Zh9on/src/HDF5.jl:683
 [4] h5open(::Function, ::String, ::String) at /Users/lutz/.julia/packages/HDF5/Zh9on/src/HDF5.jl:681
 [5] hdf5plot_write(::Plots.Plot{Plots.HDF5Backend}, ::String) at /Users/lutz/.julia/packages/Plots/12uaJ/src/backends/hdf5.jl:420
 [6] top-level scope at REPL[23]:100:

The syntax follows the documentation exactly (I think).

Is this a bug or am I making a mistake?

Unfortunately, it appears to be a newly created bug: struct Attr was created on January 28th, and my implementation of the HDF5 writer does not support the new object hierarchy.

I will see what I can do. I am not exactly certain when I will have the time to create a fix, though.

Thank you.

The solution was just merged into the master stream:
Fix broken hdf5 "backend". by ma-laforge · Pull Request #2492 · JuliaPlots/Plots.jl · GitHub

You should be able to temporarily check out the “dev” version, or wait until the next release of Plots.jl.

Thanks again!