Skip to content
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

Warning when using boxplot(x) #470

Closed
arthur-fyon opened this issue Dec 3, 2021 · 5 comments · Fixed by #486
Closed

Warning when using boxplot(x) #470

arthur-fyon opened this issue Dec 3, 2021 · 5 comments · Fixed by #486
Labels

Comments

@arthur-fyon
Copy link

arthur-fyon commented Dec 3, 2021

Since I installed Julia 1.7.0, I get the following warning while simply calling boxplot as before using the GR backend

┌ Warning: Keyword argument hover not supported with Plots.GRBackend(). Choose from: Set([:top_margin, :group, :inset_subplots, :background_color, :ytickfontsize, :yforeground_color_text, :yguidefontcolor, :tickfontfamily, :show_empty_bins, :seriesalpha, :seriescolor, :ztick_direction, :xgrid, :ygridalpha, :zlims, :xtick_direction, :colorbar, :legend_font_family, :zflip, :ticks, :linealpha, :overwrite_figure, :arrow, :xguidefonthalign, :normalize, :linestyle, :xtickfontvalign, :xflip, :zgrid, :fillcolor, :ygrid, :bar_width, :colorbar_scale, :background_color_inside, :zguidefonthalign, :bins, :zguide, :zforeground_color_text, :legend_font_valign, :yscale, :legend_font_color, :weights, :xgridalpha, :ygridstyle, :clims, :xtickfontcolor, :fill_z, :xguide, :markershape, :background_color_subplot, :ztickfontfamily, :fillalpha, :markerstrokewidth, :tick_direction, :xguidefontvalign, :xguidefontfamily, :gridlinewidth, :foreground_color_subplot, :xgridlinewidth, :yguidefontsize, :foreground_color, :foreground_color_text, :titlefonthalign, :yerror, :x, :xtickfonthalign, :zgridlinewidth, :ytickfontrotation, :discrete_values, :ytick_direction, :grid, :xguidefontrotation, :ribbon, :xguidefontsize, :tickfontrotation, :xforeground_color_axis, :xdiscrete_values, :background_color_outside, :titlefontcolor, :xgridstyle, :line_z, :size, :orientation, :gridstyle, :projection, :markersize, :legend_foreground_color, :camera, :zguidefontrotation, :ydiscrete_values, :xforeground_color_grid, :seriestype, :yflip, :quiver, :zticks, :markerstrokecolor, :ztickfontrotation, :ztickfonthalign, :fillrange, :ztickfontvalign, :xlims, :xforeground_color_border, :markercolor, :xtickfontsize, :ylink, :levels, :color_palette, :connections, :yforeground_color_grid, :lims, :zgridstyle, :foreground_color_border, :zguidefontvalign, :xscale, :marker_z, :markerstrokealpha, :left_margin, :markeralpha, :legend_font_halign, :annotations, :window_title, :tickfontvalign, :foreground_color_axis, :zguidefontcolor, :ygridlinewidth, :zlink, :zscale, :smooth, :yguidefontrotation, :xticks, :guidefontsize, :zguidefontsize, :y, :margin, :ytickfontcolor, :zdiscrete_values, :tickfonthalign, :bottom_margin, :yforeground_color_border, :zguidefontfamily, :framestyle, :yguidefontvalign, :yguidefonthalign, :zerror, :zgridalpha, :ztickfontcolor, :scale, :legend_position, :linecolor, :html_output_format, :legend_title, :zforeground_color_border, :legend_font_pointsize, :title, :tickfontcolor, :subplot_index, :flip, :titlefontrotation, :legend_background_color, :tickfontsize, :titlefontvalign, :z, :yforeground_color_axis, :foreground_color_grid, :xtickfontrotation, :linewidth, :ztickfontsize, :gridalpha, :xerror, :guidefontfamily, :ylims, :contour_labels, :xguidefontcolor, :primary, :xtickfontfamily, :ytickfontvalign, :guidefonthalign, :ytickfontfamily, :aspect_ratio, :xforeground_color_text, :show, :link, :colorbar_title, :guidefontrotation, :subplot, :label, :ytickfonthalign, :guide, :guidefontcolor, :yguide, :titlefontsize, :titlefontfamily, :guidefontvalign, :zforeground_color_axis, :zforeground_color_grid, :layout, :legend_font_rotation, :colorbar_entry, :yguidefontfamily, :polar, :right_margin, :xlink, :series_annotations, :yticks]) └ @ Plots C:\Users\arthu\.julia\packages\Plots\AJMX6\src\args.jl:1607

However, the boxplot appears fine as with Julia 1.6.X. If I exectue a second time, the warning does not show again. It seems that this warning should not be there, since the boxplot is fine. Note that simply executing

using StatsPlots; x = rand(20); boxplot(x)

make the warning appears once.

Thanks in advance.

@sethaxen sethaxen changed the title Warning when using boxplot(x) on Julia 1.7.0 Warning when using boxplot(x) Dec 3, 2021
@sethaxen
Copy link
Member

sethaxen commented Dec 3, 2021

I just checked, and in a fresh environment, this happens on v1.6.4 as well. I don't think this is a problem. Only plotly supports the hover attribute, and it's been used here for a long time. I'm guessing Plots recently changed its warning policy, which is why you're seeing the warning now.

@sethaxen
Copy link
Member

@mkborregaard @BeastyBlacksmith is there something we can do here so that this warning isn't thrown for every backend but Plotly? In the REPL it's harmless, but in notebooks (e.g. see at 1:00 in the video in fonsp/Pluto.jl#1870 (comment)), it looks pretty bad.

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented Feb 2, 2022

I think the easiest would be to only add the hover entries in the recipe if the backend is plotly or plotlyjs.
Or check if hover is in the supported attributes of the backend.

@sethaxen
Copy link
Member

sethaxen commented Feb 4, 2022

Or check if hover is in the supported attributes of the backend.

How can we access the backend within a recipe, and how can we access the supported attributes?

@BeastyBlacksmith
Copy link
Member

Plots.is_attr_supported(backend(), [:hover])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants