Configuring the browser used to display Gadfly graphs in Julia

I am using Julia 0.4.5 on Windows 7. When I call Gadfly.plot , Internet Explorer opens to display the graph.

How do I configure Julia to use a browser of her choice (e.g. Google Chrome) to display Gadfly graphs?

+5
source share
2 answers

Gadfly seems to use this function to open the .html file:

 function open_file(filename) if OS_NAME == :Darwin run(`open $(filename)`) elseif OS_NAME == :Linux || OS_NAME == :FreeBSD run(`xdg-open $(filename)`) elseif OS_NAME == :Windows run(`$(ENV["COMSPEC"]) /c start $(filename)`) else warn("Showing plots is not supported on OS $(string(OS_NAME))") end end 

So, for Windows, you can write your alternate cmd.exe (perhaps a byte that checks if the .html argument is then run chrome or pass true cmd.exe) and replace ENV["COMSPEC"]

+6
source

try: Set Google Chrome as the default browser for all .html or .htm files.

0
source

Source: https://habr.com/ru/post/1245965/


All Articles