Plotting in VSCode on two or more plot windows

I am analysing large data sets, with each analysis generating 10s of plots (Plots.jl with the plotly() backend).

I want to compare these plots but generated under a separate condition. On VS Code it puts the plots in a separate tab or pane, and I can move forward and backward through one series of plots using the arrows. But I cannot seem to separate out the plots into different panes, e.g. to put two plots side by side to compare them.

Any ideas on how to get two separate plot tabs up on VS Code? Or any other suggestions on how I could do this?

1 Like

As far as I can tell, that is not possible. I think it would be a good feature request.

My workaround is this function, which permits me to plot it in a browser. It’s the next best thing for now, but keen to hear if someone has another solution:

    """
    Permits plotting in browser 
    """
    function browser(p)
        tmp_filename = "plot.html"
        Plots.savefig(p, tmp_filename)
        if Sys.islinux()
            firefox_dir = "/usr/lib/firefox/firefox.sh"
            run(`$firefox_dir $tmp_filename`)
        elseif Sys.iswindows()
            firefox_dir = raw"C:/Program Files/Mozilla Firefox/firefox"
            run(`$firefox_dir $tmp_filename`)
        elseif Sys.isapple()
            firefox_dir = "/Applications/Firefox.app"
            run(`$firefox_dir $tmp_filename`)
        end
    end 
1 Like

Maybe not an optimal solution either, but you could tell VSCode to not use the built in plotting windows and instead fall back to the native ones using the command Julia: Disable Plot Pane. For plotly I think that would be browser, so similar end effect as your script.

2 Likes