Displaying plots in VegaLite opens vscode


#1

I have no idea what configuration is wrong, but when I try to display a simple plot from VegaLite, a new instance of vscode opens.

It happens when I do:

using VegaLite, VegaDatasets
data = dataset("cars")
data |> @vlplot(:point, x=:Miles_per_Gallon, y=:Horsepower, column=:Origin, color=:Cylinders)

or

p = data |> @vlplot(:point, x=:Miles_per_Gallon, y=:Horsepower, column=:Origin, color=:Cylinders);
display(p)

Thanks in advance for your help


#2

What operating system are you on?


#3

Ubuntu 18.04


#4

This probably means that you have your mime-type default application set wrong. You need to find out what output is produced by vegas, probably svg or png. And then check that the right program opens it, maybe start here: https://itsfoss.com/change-default-applications-ubuntu.


#5

I tested the format that VegaLite opens on my Windows machine. It is SVG. I can confirm that “Image Viewer” opens SVG on my Ubuntu machine. When I save a plot in SVG format, I can double click on it and it opens in Image viewer. So it seems the default application is set correctly on Ubuntu.

Could it be that there is a default application for SVG files on REPL?


#6

The problem was the default application to open .html files. It is solved now. Thanks for your insight.