# Vizcon , 29th-30th Oct Berlin

**URL:** <https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326>\
**Category:** Community\
**Created:** [November 8, 2018, 10:44pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326 "2018-11-08T22:44:06Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [November 10, 2018, 5:11pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/21 "2018-11-10T17:11:07Z")

</div>

> [@jonathanBieler](#):
>
> Interact looks a bit like an AbstractGUIs but at the same time it looks to be tied to web technologies

I would actually like to change that. The core of Interact (Widgets + Observables) is independent of web things and I hope could serve as a general basis.

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [November 10, 2018, 10:00pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/22 "2018-11-10T22:00:15Z")

</div>

Thanks for good reporting. I’m a simple Julia user, and have tried to understand the Plots syntax. I’m interested in Makie, but don’t have a clear idea of its role:

- Is Makie a replacement of Plots as a meta plotting package? In other words: will Makie need backends like Plots does?
- Is the plan to make Plots statements workable for Makie (`plot()`, `plot!()`, `linewidth=…`, `xlabel=()`, etc.), or should one just as well get used to Makie commands?
- Is there/will there be support for LaTeX style commands for specifying math typography?

I really appreciate your hard work! Good/fast graphics is essential for Julia’s success!

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [November 11, 2018, 7:44pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/23 "2018-11-11T19:44:17Z")

</div>

- Makie can have backends - so if you read my post above you see that a GR backend was implemented at vizcon. But the relationship to them is different - the backends just handle the drawing, and Makie is thus not a meta-package as such, it’s fully standalone.

- I think it’s safe to say now that the syntax will stay somewhat different from that of Plots. But it’s fairly similar.

- I’d be surprised if not but don’t know.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 12, 2018, 8:42am UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/24 "2018-11-12T08:42:12Z")

</div>

One thing that I like about Matlab’s graphics, and which I could never quite figure out in Plots.jl, is that you can easily get access to the various plot objects (lines, axes, text, figures, legends, etc. etc.), and then manipulate them directly. This is extremely convenient, and lets me pass off, e.g. a line object, to some function that can update it whenever, without caring about which figure it belongs to or anything else.

In Plots.jl the only way of interfacing with graphics elements, _that I could find_, was through the entire _plot object_, which remains quite opaque to me. For example, mutating the linestyle or getting/changing the data of one single line among many, _after_ having plotted it, was something I failed at. Or retrieving a handle to, say, “the red, dotted, line” in some axis, which you can accomplish with `findobj` in Matlab.

Whenever I tried to explore the ‘plot object’ in Plots.jl I got nowhere, unable to find the lines and tick marks or colorbar, etc.

Did I miss something big (I never did get very familiar with Plots.jl)? And do you think that a future design will include graphics objects, similar to Matlab or Matlplotlib?

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 12, 2018, 9:19am UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/25 "2018-11-12T09:19:22Z")

</div>

> [@DNF](#):
>
> Whenever I tried to explore the ‘plot object’ in Plots.jl I got nowhere, unable to find the lines and tick marks or colorbar, etc.

My uneducated guess why this is hard, is that Plots.jl is, as has been mentioned, a meta-package, and has to interface with a lot of different backends, which again own the actual plot objects. I can see how that makes it difficult, or even nearly impossible to expose very fine grained control over individual graphics elements.

But is this something that is likely to be different in a future Plots.jl/Makie.jl high-level package, or is the functionality I’m looking for rather something that can only be accessible by directly working with a lower-level, backend package?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 12, 2018, 9:38am UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/26 "2018-11-12T09:38:22Z")

</div>

> [@DNF](#):
>
> directly working with a lower-level, backend package?

Possibly the latter, but what is it that you want to accomplish? I don’t use Matlab, but an example would be useful.

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [November 12, 2018, 10:08am UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/27 "2018-11-12T10:08:23Z")

</div>

My understanding is that the issue is between two different approaches of making plots in practice. Say I get the plot somewhat right, but I still want to tweak it a bit more: in a cartoon example I do `plot(x, y, color = :blue)` but I actually wanted it to be red. I could either

1. Edit my plot function call and try again (Plots approach)
2. Edit the plot object directly (possible in Matlab, less so in Plots)

It’s a bit of a preference of style, with some performance considerations: if the plot also computed some heavy statistics I do not want to recompute them just to tune the colorscheme.

> [@DNF](#):
>
> In Plots.jl the only way of interfacing with graphics elements, _that I could find_ , was through the entire _plot object_ , which remains quite opaque to me. For example, mutating the linestyle or getting/changing the data of one single line among many, _after_ having plotted it, was something I failed at.

I think here there’s a different design philosophy between Matlab, Plots and Makie (I haven’t used Matlab in a while, but I think it’s really 3 distinct approaches).

In Plots you can mutate some things after the plot is done (say `xlabel!` or things like that) but it’s not supported in general. The reason (at least my understanding of it) is that there is a rather sophisticated pipeline that consumes all attributes and deduces some attributes from the initial ones. So if I were to change `p[1][1][:seriescolor]` after the plot is done, this wouldn’t really have an effect, because for example the overall seriescolor only affects the line as `:linecolor` defaults to it, so there actually is no way to know how the plot would change without re-running the pipeline. This precludes approach 2) for making plots and makes creating animations less smooth as we need to rerun the pipeline for every frame. This was one of the major design difference that justified the Makie project.

Makie is quite different in that there is in some sense a “pipeline” (less complex than in Plots), in that some things may depend on others, but it is done via `Observables` and reactive programming so that the plot knows how to update if one attribute is changed.

For example if I do:

```julia
julia> p = Makie.scatter(rand(10), rand(10))

```

Now `p` is a scene whose last plot is the scatter, so:

```julia
julia> p[end]
Scatter{...}
attributes:
  colormap : Symbol
  visible : Bool
  scatter : Attributes
  axis : Attributes
  text : Attributes
  axis2d : Attributes
  linesegments : Attributes
  camera : AbstractPlotting.Automatic
  cam2d : Attributes
  font : String
  axis_type : AbstractPlotting.Automatic
  annotations : Attributes
  raw : Bool
  clear : Bool
  legend : Attributes
  resolution : Tuple{Int64,Int64}
  center : Bool
  color : Symbol
  show_legend : Bool
  padding : Vec{3,Float32}
  backgroundcolor : RGBA{Float32}
  show_axis : Bool
  scale_plot : Bool
  limits : AbstractPlotting.Automatic

```

and now I’m free to edit these attributes at will:

```julia
julia> p[end].color
Observable{Any} with 1 listeners. Value:
:black

julia> p[end].color = :red
:red 

```

And the plot will update without the need to be redrawn. An extra advantage is that the framework for updating things in real time that’s used here (`Obsevables`) is the same as in Interact, so it’s in principle quite easy to get these updates from `Interact` widgets. I could actually set the color to be a `colorpicker` from Interact and the plot would update smoothly without being redrawn as soon as the user interacts with the color wheel.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [November 12, 2018, 10:15am UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/28 "2018-11-12T10:15:59Z")

</div>

I believe this was exactly one of the points of critique of Plots that Simon wanted to address with designing Makie.

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [November 12, 2018, 10:16am UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/29 "2018-11-12T10:16:00Z")

</div>

Note that some of the “attributes” of the scatter plot are of type `Attributes` (basically a dict of updating signals, technically `Dict{Symbol, Observable}`). This means that there is a nested structure of attributes, so for everything regarding the axis, I would look into the `axis` attributes and see which of those need to be changed.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 12, 2018, 12:39pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/30 "2018-11-12T12:39:43Z")

</div>

Thanks for this very informative reply.

It actually sounds like Makie provides basically the sort of functionality I’m interested in. It sounds like it would be possible to just take `p[i]` and pass it off to some function to manipulate.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 12, 2018, 12:43pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/31 "2018-11-12T12:43:00Z")

</div>

> [@mkborregaard](#):
>
> I believe this was exactly one of the points of critique of Plots that Simon wanted to address with designing Makie.

I’m encouraged to hear that these concerns are a part of the design process. The reason I asked was that, despite browsing quite a few plotting discussions, I haven’t seen it brought up before. I haven’t even seen anyone asking about it on Discourse or stackoverflow, (though, naturally, I have missed a lot.)

> [@Tamas\_Papp](#):
>
> Possibly the latter, but what is it that you want to accomplish? I don’t use Matlab, but an example would be useful.

Partly, it’s about performance. I’d like to avoid a lot of drawing being redone when changing very specific things in a complex plot.

But more fundamentally, it’s about separation of concerns (I think it’s called). It’s very convenient to be able to take a reference to a line, send it to some process, and just let it modify very specific properties, without it having to know _anything_ about the rest of the plot.

As an example, I have a gui, where a user manipulates some parameter. Then some function would take that parameter value and the line reference and update the line’s data. All the other plot elements are then just a distraction, and makes the functionality of the ‘updater function’ less generic. In fact, this could be more generic, if I didn’t have to send a ‘line object’ _at all_. Ideally, I’d just send an array to be mutated, and that would be translated into a plotting update, if appropriate.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [November 12, 2018, 12:52pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/32 "2018-11-12T12:52:20Z")

</div>

See the Makie docs - [http://makie.juliaplots.org/stable/why-makie.html](http://makie.juliaplots.org/stable/why-makie.html) Some of that is out-of-date (e.g. we don’t have world age issues anymore) but I think it documents the thought process

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 12, 2018, 12:55pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/33 "2018-11-12T12:55:51Z")

</div>

> [@mkborregaard](#):
>
> See the Makie docs - they currently are offline but here’s the source file

Thanks. But, aren’t the Makie docs here [http://makie.juliaplots.org/stable/](http://makie.juliaplots.org/stable/) ?

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [November 12, 2018, 1:00pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/34 "2018-11-12T13:00:50Z")

</div>

Yes they were just offline when I went there - came back to fix the link.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 12, 2018, 1:40pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/35 "2018-11-12T13:40:08Z")

</div>

> [@DNF](#):
>
> Partly, it’s about performance. I’d like to avoid a lot of drawing being redone when changing very specific things in a complex plot.

Possibly I am missing something about the contexts, but in modern graphical frameworks,

1. the rendering of a (static) plot on screen is usually the cheapest operation,
2. it happens anyway for the whole plot when elements are changed (eg if I make the axes blue, it won’t just re-render those specific pixels).

> [@DNF](#):
>
> But more fundamentally, it’s about separation of concerns (I think it’s called). It’s very convenient to be able to take a reference to a line, send it to some process, and just let it modify very specific properties, without it having to know _anything_ about the rest of the plot.

I would usually do this by breaking up the code that generates the plot into smaller functions, with each doing one thing, and just (re)generate variants of a plot from various building blocks.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 12, 2018, 1:46pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/36 "2018-11-12T13:46:51Z")

</div>

> [@Tamas\_Papp](#):
>
> 1. the rendering of a (static) plot on screen is usually the cheapest operation,
> 2. it happens anyway for the whole plot when elements are changed (eg if I make the axes blue, it won’t just re-render those specific pixels).

I guess this depends on the framework (or what counts as ‘modern’). In Matlab, at least, issuing a whole new `plot` command is dramatically more expensive than

```julia
myline.YData(5) = 11

```

and makes the difference between a smooth live-update, and a slow mess.

> [@Tamas\_Papp](#):
>
> I would usually do this by breaking up the code that generates the plot into smaller functions, with each doing one thing, and just (re)generate variants of a plot from various building blocks.

I’m not sure if I understand this. But, I’m thinking of a situation where a plot has been produced by whatever complicated (or even unknown) process, and I want to let some _other_ process update some arbitrary element. Having to use the original code seems quite limiting.

Oh, and the ‘other process’ should also be able to update whichever element I throw at it. Sometimes I give it the blue line to update, another time, the red line.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [November 12, 2018, 1:50pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/37 "2018-11-12T13:50:25Z")

</div>

> [@DNF](#):
>
> In fact, this could be more generic, if I didn’t have to send a ‘line object’ _at all_ . Ideally, I’d just send an array to be mutated, and that would be translated into a plotting update, if appropriate.

That’s exactly the principle behind [Observables](https://github.com/JuliaGizmos/Observables.jl/). You can do the same thing with the values that correspond to GUI controls. For example, suppose an “entry box” is linked to an Observable; any time you type something into the box and hit enter, it modifies the value stored in the Observable, which then notifies downstream consumers that only make use of the Observable and don’t have to know the details of the GUI toolkit.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [November 12, 2018, 1:58pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/38 "2018-11-12T13:58:49Z")

</div>

One example is saving plots on disk in Matlab and reloading them later on. You can even have plots that colleagues sent you. Then if you want to standardise the font you can easily do it with a few lines of code. Of course it’s better to have a nice script that can generate the plot from scratch but in practice it’s not always the case.

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [November 12, 2018, 2:44pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/39 "2018-11-12T14:44:35Z")

</div>

> [@DNF](#):
>
> Ideally, I’d just send an array to be mutated, and that would be translated into a plotting update, if appropriate.

This is already the case with Makie, i.e. you can do:

```julia
v = Observable(rand(100))
scatter(v)

```

and the plot will update when the observable updates. One of the challenges of the design that is being worked on in these days is how to allow the user to create recipes without worrying about Observables, so that this automated efficient updating also works in user recipes.

> [@jonathanBieler](#):
>
> One example is saving plots on disk in Matlab and reloading them later on. You can even have plots that colleagues sent you. Then if you want to standardise the font you can easily do it with a few lines of code. Of course it’s better to have a nice script that can generate the plot from scratch but in practice it’s not always the case.

This is definitely an interesting point but we’d need a way to save the plot that “preserves the structure” in Makie. Naively trying to save the plot with JLD2 crashed my Julia session but maybe there are fixes.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 12, 2018, 3:04pm UTC](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326/40 "2018-11-12T15:04:18Z")

</div>

> Naively trying to save the plot with JLD2 crashed my Julia session but maybe there are fixes.

That’s of course a feature 😛  
Joke aside, I already pushed a fix to serialize a Makie scene to disc via `Serializer.(de)serialize` - which works quite nicely, even for GUIs and interactions!  
A fix for JLD2 shouldn’t be too hard (was it supporting closures though? Sadly, there are quite a few places where closures become part of the scene graph so we’d need to serialize them).

[Previous page](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326.md?page=1)

[Next page](https://discourse.julialang.org/t/vizcon-29th-30th-oct-berlin/17326.md?page=3)
