Plots units of measure


#1

Hello

I had a plot code using margins that was working correctly. I started getting the following error

plot(pl1,pl2,layout=grid(2,1,heights=[0.7,0.2]),size=(800,400),left_margin=10)

MethodError: no method matching +(::Measures.Length{:mm,Float64}, ::Int64)
Closest candidates are:
  +(::Any, ::Any, ::Any, ::Any...) at operators.jl:424
  +(::Complex{Bool}, ::Real) at complex.jl:247
  +(::Char, ::Integer) at char.jl:40`

The backend is plotly. What is the correct use of this?

thanks


#2

Use:

using Measures
plot(pl1,pl2,layout=grid(2,1,heights=[0.7,0.2]),size=(800,400),left_margin=10mm)

#3

Alternatively using Plots.PlotMeasures. There were complaints that the workspace was exporting too many names.