And here is the resulting plot. Something is off, if you look at the number on the y axis, I should be in the range hundred of thousands, but it shows 1600. Also, this code causes regular crashes of Pluto. I have 24 threads and 70 Go of ram so it shouldn’t be a hardware issue.
The VegaLite Tutorial has an example using the Vega.printrepr() function to generate the @vlplot style version of a JSON specification as from the vega-lite site.
As mentioned by @devel-chm, the vega-lite docs have a detailed documentation to customize the binning. In particular, if you want to fix the bin width, you can do it with the step property of the bin parameters.
In VegaLite.jl probably you need to do x={:BQBZ, bin={step=0.2}}.
In Deneb.jl, you can have a look at this example and replace maxbins=50 with step=0.2.
As for the crashes in Pluto. Is your df_BQBZ dataset very large? VegaLite charts store the whole data in its specification, so several plots with fairly large data can easily result in slow responsiveness (and possibly crashes?). You can see more about that in Altair’s documentation. A common approach to solve that is to pre-aggregate the data (e.g. binning) and filter it to keep only the columns that the figure needs.
Thanks, your solution works beautifully. I still sometimes have issues with the Julia syntax. I am not coming from an IT background. The data sets are relatively large. We are in a million data points. I switched to a Jupyter notebook, and there was no problem.
Thank you for mentioning Deneb.jl I did not know about it.