Has anyone figured out how to render a plot using sp_execute_external_script where the plot is returned in the SQL Management Studio result window or the message window or a popup window? I was able to output a plot to the file system but that is not ideal.
Below is how I got a plot to output to the file system.
EXECUTE sp_execute_external_script
@language = N'R'
, @script = N' trellis.device(device="png", filename="c:/output/HistPlot.png");
myHist=histogram(~col1, data=InputDataSet);
print(myHist)'
, @input_data_1 = N'SELECT col1, col2 from ds.dbo.[sample]'

