-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to customize download plot options? #326
Comments
Hi @ZenanH, You can use the You can reproduce the linked example from the plotlyjs documentation by adapting to PlotlyJS.jl syntax with the following code: using PlotlyJS
trace1 = scatter(
x=[0, 1, 2, 3, 4, 5, 6],
y= [1, 9, 4, 7, 5, 2, 4],
mode= "markers",
marker_size = [20, 40, 25, 10, 60, 90, 30]
)
layout = Layout(;
title= "Download Chart as SVG instead of PNG",
showlegend= false
);
config = Dict(
:toImageButtonOptions => Dict(
:format => "svg", # one of png, svg, jpeg, webp
:filename => "custom_image",
:height => 500,
:width => 700,
:scale => 1 # Multiply title/legend/axis/canvas sizes by this factor
)
);
plot(trace1,layout;options=config) |
Thanks, it worked! I hadn't noticed it in the documentation before.😅 |
Hello! Unfortunately, the code above no longer works for me. If I call Thanks! |
The following lines of code do save a html version of the plot:
If you are working with the default style, then remove the style setting from the plot definition. |
Thanks, @empet! Unfortunately, that part was already working for me -- I have no problem writing the HTML file and having the plot render in my browser. My issue is specifically with being able to specify the format and dimensions of the image that the browser will save when I click Plotly's "download image" button. In fact, in the PlotlyJS.jl source tree, the minimal example given in |
In the documentation for the
Plotly Javascript
, I noticed that the options for downloading plot can be changed. I would like to do a similar setup inPlotlyJS.jl
to download plot directly inSVG
format, what should I do? 😅The text was updated successfully, but these errors were encountered: