# \[Makie\] Get data from figure

**URL:** https://discourse.julialang.org/t/makie-get-data-from-figure/96053
**Category:** Visualization
**Tags:** makie
**Created:** [March 14, 2023, 2:01pm UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053 "2023-03-14T14:01:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)
#### Post date: [March 14, 2023, 2:01pm UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053/1 "2023-03-14T14:01:22Z")

</div>

Given a `Figure`, is it possible to get the Arrays with the data? I want to do tests on automatically setting legal limits for log scale plots by automatically adjusting limits to hide the offending points, and printing a warning.

---

<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: [March 14, 2023, 4:33pm UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053/2 "2023-03-14T16:33:09Z")

</div>

The axes are in `figure.content`, from there you can do `ax.scene.plots` to get the plots, and check their inputs. Is that what you mean?

---

<div class="post-metadata">

### Author: ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)
#### Post date: [March 15, 2023, 11:31am UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053/3 "2023-03-15T11:31:08Z")

</div>

Yes! Thanks

---

<div class="post-metadata">

### Author: ![bjarthur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bjarthur/32/9638_2.png) [@bjarthur](https://discourse.julialang.org/u/bjarthur)
#### Post date: [March 1, 2024, 2:15pm UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053/4 "2024-03-01T14:15:29Z")

</div>

sorry for being dumb about this, but i need a further hint. `ax.scene.plots[1]` has the following fields. which one contains the inputs? i can’t find it:

```julia
alpha calculated_colors color colormap colorrange
colorscale cycle depth_shift distancefield fxaa
glowcolor glowwidth highclip inspectable lowclip
marker marker_offset markersize markerspace model
nan_color overdraw rotations space ssao
strokecolor strokewidth transform_marker transformation transparency
uv_offset_width visible

```

---

<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: [March 1, 2024, 8:53pm UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053/5 "2024-03-01T20:53:50Z")

</div>

there is an `.args` field and a `.converted` field but those are kind of internal

---

<div class="post-metadata">

### Author: ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)
#### Post date: [March 4, 2024, 1:42pm UTC](https://discourse.julialang.org/t/makie-get-data-from-figure/96053/6 "2024-03-04T13:42:33Z")

</div>

```julia
julia> fig, ax, plt = plot(0:10, sin.(0:10));

julia> fig.content[1].scene.plots[1].input_args
(Observable(0:10), Observable([0.0, 0.8414709848078965, 0.9092974268256817, 0.1411200080598672, -0.7568024953079282, -0.9589242746631385, -0.27941549819892586, 0.6569865987187891, 0.9893582466233818, 0.4121184852417566, -0.5440211108893698]))

```

Or, alternatively:

```julia
julia> fig.content[1].scene.plots[1][1][]
11-element Vector{Point{2, Float32}}:
 [0.0, 0.0]
 [1.0, 0.84147096]
 [2.0, 0.9092974]
 [3.0, 0.14112]
 [4.0, -0.7568025]
 [5.0, -0.9589243]
 [6.0, -0.2794155]
 [7.0, 0.6569866]
 [8.0, 0.98935825]
 [9.0, 0.4121185]
 [10.0, -0.5440211]

```

As you can see by the gymnastics required to extract the values, this is mucking about in the internals. Perhaps it would be nice to have a function that takes an axis, and returns all data currently in it?
