-
-
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
Style() not defined #408
Comments
That is right -- we have removed I am happy to provide support in helping you transition to the new template system. Could you please provide some code examples that you were using before and I can show you the way to do things going forward? Thanks and sorry for breaking change |
Thank you for fast response. I have function: function set_plotly_style()
return fig_style = let
axis = attr(showgrid=true, gridcolor="#e9e9e9", linewidth=1.5,
linecolor="#555555",
titlefont_color="#555555",
titlefont_size=16, ticks="outside",
tickcolor="#555555", zeroline=false
)
layout = Layout(plot_bgcolor="#ffffff",
paper_bgcolor="white",
font=attr(family="Arial"),
font_size=14,
xaxis=axis,
yaxis=axis,
titlefont_size=14,
yaxis_title_standoff=1, yaxis_automargin=true,
legend=attr(font_size=12, bgcolor="white",
bordercolor="#555555", borderwidth=1))
Style(layout=layout)
end
end and then I just use fig_style = set_plotly_style()
use_style!(fig_style) |
@sglyon |
All the functionality that Styles used to provide is still available to us using templates. The benefit is that we integrate with the other plotly libraries and leave the implementation of applying styles to plotly.js itself instead of having to do it here @otobrzo example above can now be written: function set_plotly_template()
axis = attr(
showgrid=true, gridcolor="#e9e9e9", linewidth=1.5,
linecolor="#555555",
titlefont_color="#555555",
titlefont_size=16, ticks="outside",
tickcolor="#555555", zeroline=false
)
layout = Layout(
plot_bgcolor="#ffffff",
paper_bgcolor="white",
font_family="Arial",
font_size=14,
xaxis=axis,
yaxis=axis,
titlefont_size=14,
yaxis_title_standoff=1, yaxis_automargin=true,
legend=attr(
font_size=12, bgcolor="white",
bordercolor="#555555", borderwidth=1
)
)
# CHANGE: create a `Template` instead of a `Style`
Template(layout=layout)
end
fig_template = set_plotly_template()
# CHANGE: add the template under the "personal" key
templates.personal = fig_template
# CHANGE: set the default template to the "personal" template -- must match key from previous step
templates.default = "personal" |
I'm going to close here now, but if you find examples that are not working please let me know and we'll work on them together |
Thank you for the update. I have one use case. pp = plot_subplots()
pp.style = mystyle |
Sorry i don’t think I followed. Was the most recent post another question? |
I just wanted to clarify the style transfer to subplots: http://juliaplots.org/PlotlyJS.jl/stable/styles/ says in a note:
However, It seems to me template approach is transferred to a subplot, so everything is fine. Thank you |
Hi @sglyon could please help me adapt this code to be used with Templates?
This is what I have so far
Where do I put the global trace? Also, is there any documentation on how to use Templates for Julia? The official docs still tell you to use Styles. Thank you |
This is the template with your settings:
Checked it on the following plots:
and:
|
This was two years ago and the deprecated Styles are still in the documentation. This changed isn't mentioned anywhere. http://juliaplots.org/PlotlyJS.jl/stable/styles/#Using-Styles |
I have upgraded PlotlyJS to version 0.18.3 (from 0.14) and Style(), use_style!() commands are no more defined.
The text was updated successfully, but these errors were encountered: