# Plots visualization differences between VSCode and export

**URL:** <https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [April 8, 2021, 10:29am UTC](https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817 "2021-04-08T10:29:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![felcbd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felcbd/32/37642_2.png) [@felcbd](https://discourse.julialang.org/u/felcbd)\
**Post date:** [April 8, 2021, 10:29am UTC](https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817/1 "2021-04-08T10:29:23Z")

</div>

Hello everyone,  
Was doing some plotting to display a Gantt Chart with VegaLite, and I tried the save() function I saw on a basic example for VegaLite usage.  
But there is some modifications from the save() function, compared to the visualization in VSCode JuliaPlots, as you can see :  
VSCODE  
 ![fromvscode](https://global.discourse-cdn.com/julialang/original/3X/7/9/7941d2506c391cb4fea17a62f7e54eeb0a0d1763.png)

EXPORT  
 ![fromexport](https://global.discourse-cdn.com/julialang/original/3X/8/b/8b00de1134381d140c515af07965928ee078edce.png)

As far as I understand what’s going on, the format of the plot is contained in VLSpec Object, and the function display() and save(), may does not share the same default VLSpec ? (Which can explain the output difference)  
So, if it’s the reason : how can I find the VLSpec for display(), and give it to the save() function?

Thanks in advance !

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 8, 2021, 11:05am UTC](https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817/2 "2021-04-08T11:05:48Z")

</div>

You can just set width and height, e.g.:

```julia
@vlplot(
    ...,
    width=300, height=200,
    ...

```

If these values aren’t explicitly set they seem not to be part of the VLSpec, as you can see with `dump()`, e.g.

```julia
julia> p = dataset("movies") |> @vlplot(
           :rect,
           ...
           }
       )

julia> dump(p)

```

No width,height in what is dumped out. Same when you open the Vega Editor. So, to have it fixed, it needs to be specified.

---

<div class="post-metadata">

**Author:** ![felcbd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felcbd/32/37642_2.png) [@felcbd](https://discourse.julialang.org/u/felcbd)\
**Post date:** [April 8, 2021, 11:41am UTC](https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817/3 "2021-04-08T11:41:42Z")

</div>

Thanks for the answer!  
But what I’m looking for, is more the scalable aspect of the display() function.  
With a fix size, if for an instance I get more elements on the vertical axis for example, the display function will adapt the size and I will always get a perfect square for every [x,y] “point”.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 8, 2021, 12:00pm UTC](https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817/4 "2021-04-08T12:00:30Z")

</div>

Hm, ok, can’t say something, because when I do this in VSCode, for me, it opens in the plots pane (or browser if switched off) and the size is fixed and I can’t change any display size to adapt for anything.  
Let’s see who else comes to help…

---

<div class="post-metadata">

**Author:** ![felcbd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/felcbd/32/37642_2.png) [@felcbd](https://discourse.julialang.org/u/felcbd)\
**Post date:** [April 8, 2021, 12:05pm UTC](https://discourse.julialang.org/t/plots-visualization-differences-between-vscode-and-export/58817/5 "2021-04-08T12:05:14Z")

</div>

Your idea was good though, I manage to scale it with variable width/height considering the input.  
Still want to get the exact display() configuration to get some properties lost with the save, but the scaling size was the main thing to get close from the result I want !
