JuliaPlots/Plots.jl

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

Open

#4.603 geöffnet am 15. Dez. 2022

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Julia (381 Forks)batch import
PlotlyPlotlyJSbuggood first issue

Repository-Metriken

Stars
 (1.943 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 13T 6h) (2 gemergte PRs in 30 T)

Beschreibung

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?

Contributor Guide