diff --git a/README.md b/README.md index fb01169..c184a68 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![DocumentationStatus](https://img.shields.io/badge/docs-stable-blue.svg?style=flat)](https://gcalderone.github.io/Gnuplot.jl/v1.3.0/) -**Gnuplot.jl** is a simple package able to send both data and commands from Julia to an underlying [gnuplot](http://gnuplot.sourceforge.net/) process. Its main purpose it to provide a fast and powerful data visualization framework, using an extremely concise Julia syntax. It also has automatic display of plots in both Jupyter and Juno. +**Gnuplot.jl** is a simple package able to send both data and commands from Julia to an underlying [gnuplot](http://gnuplot.sourceforge.net/) process. Its main purpose it to provide a fast and powerful data visualization framework, using an extremely concise Julia syntax. It also has automatic display of plots in Jupyter, Juno and VS Code. ## Installation diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 8650d59..e1fd16e 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -236,13 +236,18 @@ const sessions = OrderedDict{Symbol, Session}() const options = Options() function __init__() - # Check whether we are running in an IJulia, Juno or Pluto session. + # Check whether we are running in an IJulia, Juno, VSCode or Pluto session. # (copied from Gaston.jl). options.gpviewer = !( ((isdefined(Main, :IJulia) && Main.IJulia.inited) || (isdefined(Main, :Juno) && Main.Juno.isactive()) || + (isdefined(Main, :VSCodeServer)) || (isdefined(Main, :PlutoRunner)) ) ) + if isdefined(Main, :VSCodeServer) + # VS Code shows "dynamic" plots with fixed and small size :-( + options.mime[MIME"image/svg+xml"] = replace(options.mime[MIME"image/svg+xml"], "dynamic" => "") + end end