PlotlyJS shape series does not respect line attributes if markerstrokewidth == 0
#4 603 ouverte le 15 déc. 2022
Métriques du dépôt
- Stars
- (1 943 stars)
- Métriques de merge PR
- (Merge moyen 13j 6h) (2 PRs mergées en 30 j)
Description
The border for bars in histograms (and shape series, more generally) is controlled by line* attributes, but these seem to be ignored for backend Plotly/PlotlyJS if markerstrokewidth is set to 0.
Example:
using Plots, Random, Distributions
x = rand(Normal(), 100)
gr()
histogram(x, linecolor=:red, markerstrokewidth=0)
# Bars are outlined in red, as expected
histogram(x, linewidth=0, markerstrokewidth=0)
# No border, slight gaps between some bars (expected)
import PlotlyJS
plotlyjs()
histogram(x, linecolor=:red, markerstrokewidth=0)
# Bars are outlined in various colors
histogram(x, linewidth=0, markerstrokewidth=0)
# Bars are still outlined in various colors
This seems to be due to the conditional here: https://github.com/JuliaPlots/Plots.jl/blob/a21d2ad0c6378f99e9b7fa76c1d852c87b08b9a8/src/backends/plotly.jl#L770 which, as far as I can tell, doesn't have an analog in the other backends.
Can this conditional be safely removed (i.e., always set :color, :width, and :dash in plotattributes_out using lines 771-777), or would that break something else?