# Can't call functions from Makie

**URL:** https://discourse.julialang.org/t/cant-call-functions-from-makie/101797
**Category:** New to Julia
**Tags:** package, plotting
**Created:** [July 19, 2023, 6:33pm UTC](https://discourse.julialang.org/t/cant-call-functions-from-makie/101797 "2023-07-19T18:33:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bitVil](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@bitVil](https://discourse.julialang.org/u/bitVil)
#### Post date: [July 19, 2023, 6:33pm UTC](https://discourse.julialang.org/t/cant-call-functions-from-makie/101797/1 "2023-07-19T18:33:34Z")

</div>

I am trying to follow along with the Basic Tutorial on the Makie webpage. I have Makie, GLMakie and CairoMakie installed. I tried running the following code:

```julia
using CairoMakie
F = Figure(backgroundcolor = :tomato)

```

Which generates these error messages:

```julia
ERROR: MethodError: no method matching return_type(::Makie.var"#30#32"{Set{Makie.Mouse.Button}}, ::Tuple{DataType})

Closest candidates are:
  return_type(::Any, ::DataType)
   @ Core compiler\typeinfer.jl:1109
  return_type(::Any, ::DataType, ::UInt64)
   @ Core compiler\typeinfer.jl:1115

Stacktrace:
 [1] _sanitize_observer_function(f::Any, argtypes::Tuple{DataType})
   @ Makie C:\Users\foxda\.julia\packages\Makie\c5WJV\src\interaction\PriorityObservable.jl:82
 [2] on(f::Any, observable::Makie.PriorityObservable{Makie.MouseButtonEvent}; weak::Bool, priority::Int8)
   @ Makie C:\Users\foxda\.julia\packages\Makie\c5WJV\src\interaction\PriorityObservable.jl:100
 [3] on
   @ C:\Users\foxda\.julia\packages\Makie\c5WJV\src\interaction\PriorityObservable.jl:99 [inlined]
 [4] Events()
   @ Makie C:\Users\foxda\.julia\packages\Makie\c5WJV\src\types.jl:109
 [5] Scene(; clear::Bool, transform_func::Function, scene_attributes::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:camera, :backgroundcolor), Tuple{typeof(campixel!), Symbol}}})
   @ Makie C:\Users\foxda\.julia\packages\Makie\c5WJV\src\scenes.jl:135
 [6] Figure(; kwargs::Base.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:backgroundcolor,), Tuple{Symbol}}})
   @ Makie C:\Users\foxda\.julia\packages\Makie\c5WJV\src\figures.jl:70
 [7] top-level scope
   @ REPL[20]:1

```

Any help with this would be greatly appreciated!

Edit: I am using windows 10 and Julia version 1.9.2. I originally installed the CairoMakie package on jupyter. Afterwards I installed it using the julia console.

---

<div class="post-metadata">

### Author: ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)
#### Post date: [July 19, 2023, 6:54pm UTC](https://discourse.julialang.org/t/cant-call-functions-from-makie/101797/2 "2023-07-19T18:54:40Z")

</div>

This works for me on Linux. Can you provide more information about your environment?

```julia
julia> using CairoMakie
[Info: Precompiling CairoMakie [13f3f980-e62b-5c42-98c6-ff1f3baf88f0]

julia> F = Figure(backgroundcolor = :tomato)
Figure()

julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, ivybridge)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_REVISE_INCLUDE = 1
  JULIA_IMAGE_THREADS = 1

(jl_MzNuOr) pkg> st
Status `/tmp/jl_MzNuOr/Project.toml`
  [13f3f980] CairoMakie v0.10.6

(jl_MzNuOr) pkg>

```

---

<div class="post-metadata">

### Author: ![GenerallyClueless](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@GenerallyClueless](https://discourse.julialang.org/u/GenerallyClueless)
#### Post date: [July 19, 2023, 8:09pm UTC](https://discourse.julialang.org/t/cant-call-functions-from-makie/101797/3 "2023-07-19T20:09:22Z")

</div>

@bitVil Can you tell me how you had installed CairoMakie and GLMakie?

julia\> using Pkg  
julia\> Pkg.add(“GLMakie”)

… or you can enter the package manager (which I prefer, and I feel is more reliable)

julia\> ] \<— yes, it’s just a right bracket… then use backspace to leave the package manager when done

(@v1.9) pkg\> add CairoMakie

```
      .... a lot of stuff will happen here... downloading, installing compiling
      .... a lot of stuff will happen here... downloading, installing compiling
      .... a lot of stuff will happen here... downloading, installing compiling

```

(@v1.9) pkg\> ::: now press backspace to exit package mgr:::

julia\>

---

<div class="post-metadata">

### Author: ![bitVil](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@bitVil](https://discourse.julialang.org/u/bitVil)
#### Post date: [July 20, 2023, 9:14am UTC](https://discourse.julialang.org/t/cant-call-functions-from-makie/101797/4 "2023-07-20T09:14:50Z")

</div>

I am using windows 10 and julia version 1.9.2. I tried running the code in the julia console and jupyter, but got the same error message for both.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [July 20, 2023, 9:27am UTC](https://discourse.julialang.org/t/cant-call-functions-from-makie/101797/5 "2023-07-20T09:27:02Z")

</div>

Can you show what’s in your Julia environment, the output of `] st`?
