Makie:ERROR: MethodError: no method matching create_dim_conversion(::Type{Union{Missing, Float64}}) The function `create_dim_conversion` exists, but no method is defined for this combination of argument types

I upgraded Makie and the code that was working fine before started to give errors.
Has anyone encountered this problem? or Would it be better to go back to the previous version?

ERROR: MethodError: no method matching create_dim_conversion(::Type{Union{Missing, Float64}})
The function `create_dim_conversion` exists, but no method is defined for this combination of argument types.
Closest candidates are:
  create_dim_conversion(::Type{Categorical})
   @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\dim-converts\categorical-integration.jl:50
  create_dim_conversion(::Type{<:Dates.AbstractTime})
   @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\dim-converts\dates-integration.jl:61
  create_dim_conversion(::Type{<:Enum})
   @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\dim-converts\categorical-integration.jl:55
  ...

Stacktrace:
  [1] dim_conversion_from_args(values::Matrix{Union{Missing, Float64}})
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\dim-converts\dim-converts.jl:118
  [2] update_dim_conversion!
    @ C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\dim-converts\dim-converts.jl:190 [inlined]
  [3] add_dim_converts!(attr::ComputePipeline.ComputeGraph, dim_converts::Makie.DimConversions, args::Tuple{…}, input::Symbol)
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\compute-plots.jl:454
  [4] add_dim_converts!(attr::ComputePipeline.ComputeGraph, dim_converts::Makie.DimConversions, args::Tuple{…})
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\compute-plots.jl:444
  [5] _register_argument_conversions!(::Type{Contourf}, attr::ComputePipeline.ComputeGraph, user_kw::Dict{Symbol, Any})
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\compute-plots.jl:486
  [6] register_arguments!
    @ C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\compute-plots.jl:378 [inlined]
  [7] (Contourf)(user_args::Tuple{Vector{Float64}, Vector{Float64}, Matrix{Union{…}}}, user_attributes::Dict{Symbol, Any})
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\compute-plots.jl:740
  [8] _create_plot!(::Function, ::Dict{Symbol, Any}, ::Axis, ::Vector{Float64}, ::Vararg{Any})
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\figureplotting.jl:397
  [9] contourf!(::Axis, ::Vararg{…}; kw::@Kwargs{…})
    @ Makie C:\Users\whkdi\.julia\packages\Makie\6zcxH\src\recipes.jl:521
 [10] top-level scope
    @ d:\JuliaLang\beginToLearn\ziwu_visualization\MST_radar\plot_AWCN_Makie.jl:103
Some type information was truncated. Use `show(err)` to see complete types.

My package is as follows:

  [336ed68f] CSV v0.10.15
  [13f3f980] CairoMakie v0.15.4
  [35d6a980] ColorSchemes v3.30.0
  [5ae59095] Colors v0.13.1
  [717857b8] DSP v0.8.4
  [a93c6f00] DataFrames v1.7.0
  [8bb1440f] DelimitedFiles v1.9.1
  [7a1cc6ca] FFTW v1.9.0
  [86fae568] ImageView v0.12.6
  [916415d5] Images v0.26.2
βŒ… [a98d9a8b] Interpolations v0.15.1
  [ee78f7c6] Makie v0.24.4
  [10745b16] Statistics v1.11.1
  [ade2ca70] Dates v1.11.0

There are lots of this ways this could happen.
Can you open an issue with a minimal example how to reproduce the error?

@sdanisch
My confusion is that the same code and the same data were working properly before, but now they are causing an error.
Here is a test example.

julia> df_awcn_mini = df_awcn_ws[!, 17:27]
9Γ—11 DataFrame
 Row β”‚ 18.3      19.5      20.7      21.9      23.1      24.3      25.5        26.7        27.9        29.1        30.3       
     β”‚ Float64?  Float64?  Float64?  Float64?  Float64?  Float64?  Float64?    Float64?    Float64?    Float64?    Float64?   
─────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 β”‚    13.02     12.02     12.04      9.01      6.09      7.92        7.73        6.53       14.08  missing     missing    
   2 β”‚    13.2      15.18     19.26     26.11     26.4      50.49        9.79       44.81       89.12  missing     missing    
   3 β”‚    16.82     13.59     16.11     19.11     15.5      12.42       10.34        6.55        3.62  missing           2.67
   4 β”‚    14.42     14.4      14.23     13.87     13.53     40.16       27.16       39.63  missing     missing     missing    
   5 β”‚    15.58     13.53     10.47     11.44      7.87      6.88        6.79        3.62        1.34        0.42        0.76
   6 β”‚    16.87     15.65     13.45     13.12     13.31     13.11        9.65        6.09       11.1        52.25        3.03
   7 β”‚    14.0      13.28     14.37     13.62     12.15     11.23        9.35        7.88  missing     missing     missing    
   8 β”‚    17.91     15.88     14.21     13.19     13.05     12.69        8.37        6.39        9.2   missing     missing    
   9 β”‚    15.19     17.38     16.87     15.15     13.41     12.2   missing     missing     missing     missing     missing   
datetimes = DateTime("2025-06-01T00:00:00"):Hour(1):DateTime("2025-06-02T08:00:00")
    tick_positions = datetime2unix.(datetimes)  # Convert dates to Unix time (positions)
    tick_labels = Dates.format.(datetimes, "HH")
    df_awcn_mini = df_awcn_ws[!, 17:27]
    fig = Figure(; size=(1200, 900))
    ax = Axis(fig[1, 1],
        xlabel="Time UT", ylabel="Height(km)",
        title="horizonal Wind",
        xticks=(tick_positions, tick_labels),
        yticksmirrored=true, yminorticksvisible=true
    )
    ylims!(ax, 0, 30)

    h_0_30 = parse.(Float64, names(df_awcn_mini))
    ws_0_30 = Matrix(df_awcn_mini)
    # ws_0_30 = replace(Matrix(df_awcn_ws[:, 2:27]), missing => NaN)
    levels = range(extrema(skipmissing(ws_0_30))[1], extrema(skipmissing(ws_0_30))[2], length=20)

    c1 = contourf!(ax, 1:9, h_0_30, ws_0_30,
        levels=levels,
        colormap=:jet,
        extendlow=:auto,
        extendhigh=:auto)
    tightlimits!(ax)

    Colorbar(fig[1, 2], c1,
        label="horizonal wind [m/s]",
        height=Relative(0.9),
        width=20,
        labelsize=18)

    fig
1 Like

I think it’s this issue:

1 Like

In the calling side, adding the following fixes the issue. It works. Thanks for @sdanisch.

import Makie: create_dim_conversion

create_dim_conversion(union_typ::Type{Union{Missing,T}}) where {T<:Real} =
    create_dim_conversion(union_typ.b)

I encountered the error after upgrading from Makie 0.22 to Makie 0.24. I believe Makie should have fixed this bug.