JuliaPlots/Plots.jl

PlotlyJS shape series does not respect line attributes if markerstrokewidth == 0

Open

#4.603 aberto em 15 de dez. de 2022

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)Julia (381 forks)batch import
PlotlyPlotlyJSbuggood first issue

Métricas do repositório

Stars
 (1.943 stars)
Métricas de merge de PR
 (Mesclagem média 13d 6h) (2 fundiu PRs em 30d)

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?

Guia do colaborador