# GLMakie: Point2f not defined

**URL:** <https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292>\
**Category:** General Usage\
**Created:** [July 15, 2022, 10:47pm UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292 "2022-07-15T22:47:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 15, 2022, 10:47pm UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/1 "2022-07-15T22:47:54Z")

</div>

Hi all,

I have run this code smoothly yesterday, but it can’t be run anymore, it triggers an error  
**UndefVarError: Point2f not defined**

**Stacktrace:**  
\*\* [1] (::var"#1#3"{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}})(a::Float64, b::Float64)\*\*  
\*\* @ Main ./In[1]:12\*\*  
\*\* [2] lift(f::Function, o1::Observable{Any}, rest::Observable{Any}; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})\*\*  
\*\* @ Makie ~/.julia/packages/Makie/NL7Xw/src/interaction/nodes.jl:13\*\*  
\*\* [3] lift(f::Function, o1::Observable{Any}, rest::Observable{Any})\*\*  
\*\* @ Makie ~/.julia/packages/Makie/NL7Xw/src/interaction/nodes.jl:10\*\*  
\*\* [4] quadraticsliders(x::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64})\*\*  
\*\* @ Main ./In[1]:11\*\*  
\*\* [5] quadraticsliders()\*\*  
\*\* @ Main ./In[1]:4\*\*  
\*\* [6] top-level scope\*\*  
\*\* @ In[1]:24\*\*  
\*\* [7] eval\*\*  
\*\* @ ./boot.jl:373 [inlined]\*\*  
\*\* [8] include\_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)\*\*  
\*\* @ Base ./loading.jl:1196\*\*

I wonder how to make it works

1. I have tried add **using Meshes** , not working

```julia
using GLMakie

function quadraticsliders(x=-5:0.01:5)
  fig = Figure()

  ax = Axis(fig[1, 1], xlabel="X", ylabel="Y")

  sl_a = Slider(fig[2, 1], range = -3:0.01:3, startvalue = 0.)
  sl_b = Slider(fig[1, 2], range = -3:0.01:3, horizontal = false, startvalue = 0.)

  points = lift(sl_a.value, sl_b.value) do a, b
      Point2f.(x, a.*x.^2 .+ b.*x)
  end

  l = lines!(points, color = :blue)

  onany((a,b)->axislegend(ax, [l], ["$(a)x² + $(b)x"]), sl_a.value, sl_b.value)

  limits!(ax, minimum(x), maximum(x), -10, 10)

  fig
end

quadraticsliders()

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 15, 2022, 11:44pm UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/2 "2022-07-15T23:44:07Z")

</div>

Try to downgrade GLMakie to version 0.4.7 …

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 16, 2022, 6:25am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/3 "2022-07-16T06:25:21Z")

</div>

I am on GLMakie 0.4.5 and can’t upgrade it to 0.4.7

 ![Capture d’écran_2022-07-16_13-24-46](https://global.discourse-cdn.com/julialang/original/3X/b/0/b05c8700903b747d0ee2375665a262da4c477308.png)

---

<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 16, 2022, 6:30am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/4 "2022-07-16T06:30:53Z")

</div>

You have too much stuff in your environment and some of it is holding the version of Makie back. You’re on quite the old version if it doesn’t have Point2f. Either try removing incompatible packages or start with a new environment for Makie related things.

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [July 16, 2022, 7:18am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/5 "2022-07-16T07:18:31Z")

</div>

It looks like [AbstractPlotting](https://github.com/JuliaPlots/AbstractPlotting.jl) is pinning down GeometryBasics:

```julia
pkg> activate --temp
(jl_XveiI1) pkg> add AbstractPlotting
...
   Installed AbstractPlotting ─ v0.18.3
(jl_XveiI1) pkg> status -m GeometryBasics
      Status `/tmp/jl_XveiI1/Manifest.toml`
  [5c1252a2] GeometryBasics v0.3.12

```

[0.3.12](https://github.com/JuliaGeometry/GeometryBasics.jl/releases/tag/v0.3.12) is about one year older than the latest version which is [0.4.2](https://github.com/JuliaGeometry/GeometryBasics.jl/releases/tag/v0.4.2).

As stated in its [README](https://github.com/JuliaPlots/AbstractPlotting.jl), AbtractPlotting should no longer be used directly.  
So as jules said, it is advisable to start from a fresh environment and only add the packages you need.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 16, 2022, 7:58am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/6 "2022-07-16T07:58:24Z")

</div>

And if you should really need some old package versions you must add them to the compat section of your project.

I always create a backup of Manifest.toml when I have a working project before adding new packages,

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 16, 2022, 8:43am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/7 "2022-07-16T08:43:37Z")

</div>

I just know about this stuff. This is why some things can’t be run anymore

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 16, 2022, 9:04am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/8 "2022-07-16T09:04:01Z")

</div>

Thanks a lot @ederag , I just know that the GeometryBasics version that is one year older is from AbstractPlotting.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 16, 2022, 9:05am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/9 "2022-07-16T09:05:04Z")

</div>

@ufechner7 I want to know is it better to create new environment everytime we want to test Julia’ codes/file?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 16, 2022, 9:23am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/10 "2022-07-16T09:23:27Z")

</div>

For every new project I create a new environment:

```julia
mkdir new_project
cd new_project
julia --project="."
]add xxx

```

You don’t have to, but it makes it possible to use different versions of the same package per project. I often want to use old versions for old projects and new versions for new projects.

After the project has been created you can start julia like this:

```julia
julia --project

```

to activate it automatically. Of course any project can contain any number of scripts as long as these scripts need the same packages.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 16, 2022, 9:41am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292/11 "2022-07-16T09:41:39Z")

</div>

This one works,

I try

```julia
pkg> activate --temp
pkg> add <packagename>
julia> include<"glmakie2.jl">

```

to start a new environment and it still can’t work with the GLMakie, not opening the Makie GUI.  
 ![Capture d’écran_2022-07-16_16-30-14](https://global.discourse-cdn.com/julialang/original/3X/e/c/ec8abd645e0b4bcc77f6af12b8afdc79205a4f8e.png)

using yours:

 ![Capture d’écran_2022-07-16_16-39-47](https://global.discourse-cdn.com/julialang/original/3X/a/2/a2a644bbb48062bb4954fb8862eef3c24ea783d8.png)

works amazingly. Thanks for the knowledge and help. Wish you all the best.
