# Figure not defined

**URL:** <https://discourse.julialang.org/t/figure-not-defined/67235>\
**Category:** New to Julia\
**Tags:** makie\
**Created:** [August 28, 2021, 4:32pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235 "2021-08-28T16:32:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vtomar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vtomar/32/18304_2.png) [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Post date:** [August 28, 2021, 4:32pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/1 "2021-08-28T16:32:42Z")

</div>

I was following the JuliaCon 2021 youtube video: Deep dive with makie layout and I ran into problems with the very first line of code that I wrote to use the makie package:

> 

```julia
using CairoMakie
using CairoMakie.FileIO
 
f = Figure(resolution = (1000, 800))

```

I get the following error:

```julia
ERROR: UndefVarError: Figure not defined
Stacktrace:
 [1] top-level scope

```

```julia

versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, haswell)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

```

Any idea why?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 28, 2021, 4:40pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/2 "2021-08-28T16:40:01Z")

</div>

I can’t reproduce

```julia
jl_AE5UqL) pkg> st
      Status `/tmp/jl_AE5UqL/Project.toml`
  [13f3f980] CairoMakie v0.6.5

julia> using CairoMakie

julia> using CairoMakie.FileIO

julia> Figure(resolution = (1000, 800))
Scene (1000px, 800px):
  0 Plots
  0 Child Scenes

```

What’s the output of `st` for you?

---

<div class="post-metadata">

**Author:** ![vtomar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vtomar/32/18304_2.png) [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Post date:** [August 28, 2021, 4:47pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/3 "2021-08-28T16:47:08Z")

</div>

```julia

(@v1.6) pkg> st
      Status `~/.julia/environments/v1.6/Project.toml`
  [537997a7] AbstractPlotting v0.12.18
  [cbdf2221] AlgebraOfGraphics v0.2.3
  [6e4b80f9] BenchmarkTools v1.1.4
  [ad839575] Blink v0.12.5
  [336ed68f] CSV v0.8.5
  [13f3f980] CairoMakie v0.3.4
  [a93c6f00] DataFrames v1.2.2
  [5789e2e9] FileIO v1.11.0
  [713c75ef] Franklin v0.10.47
  [28b8d3ca] GR v0.58.1
  [bd48cda9] GraphRecipes v0.5.6
  [d0351b0e] InspectDR v0.4.3
  [c601a237] Interact v0.10.3
  [ee78f7c6] Makie v0.11.1
  [47be7bcc] ORCA v0.5.0
  [f0f68f2c] PlotlyJS v0.15.0
  [91a5bcdd] Plots v1.21.1
  [65254759] StatsMakie v0.2.3
  [f3b207a7] StatsPlots v0.14.26
  [b8865327] UnicodePlots v2.0.0

```

---

<div class="post-metadata">

**Author:** ![vtomar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vtomar/32/18304_2.png) [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Post date:** [August 28, 2021, 4:56pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/4 "2021-08-28T16:56:40Z")

</div>

Also, when I look at the documentation of Makie, I see usage of Scene in some places and usage of Figure in other places. Scene works fine but Figure doesn’t.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [August 28, 2021, 5:01pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/5 "2021-08-28T17:01:50Z")

</div>

> [@nilshg](#):
>
> ` [13f3f980] CairoMakie v0.6.5`

> [@vtomar](#):
>
> ` [13f3f980] CairoMakie v0.3.4`

You have a very old version installed. Try `]up` or use a seperate environment (you can create a temporary one using `]activate --temp` or `]activate ./path/to/env`) for experiments with new packages.

---

<div class="post-metadata">

**Author:** ![vtomar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vtomar/32/18304_2.png) [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Post date:** [August 28, 2021, 5:09pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/6 "2021-08-28T17:09:29Z")

</div>

I tried `]up` but it doesn’t end up updating the packages

```julia
@v1.6) pkg> up
    Updating registry at `~/.julia/registries/General`
  No Changes to `~/.julia/environments/v1.6/Project.toml`
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`

```

---

<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:** [August 28, 2021, 5:24pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/7 "2021-08-28T17:24:01Z")

</div>

In such cases you need to do `]add CairoMakie@version` where version is the latest one, then you’ll be told why it can’t be installed.

---

<div class="post-metadata">

**Author:** ![vtomar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vtomar/32/18304_2.png) [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Post date:** [August 28, 2021, 5:31pm UTC](https://discourse.julialang.org/t/figure-not-defined/67235/8 "2021-08-28T17:31:28Z")

</div>

Very helpful. Thank you so much. WebIO and other packages required specific versions that were causing Makie to not be upgraded to latest version. Removing those packages and upgrading CairoMakie helped resolve the issue.
