Skip to content

Legend does not reflect linecap specified in lines! (CairoMakie) #5525

@tsiayigong

Description

@tsiayigong
  • what version of Makie are you running? (]st -m Makie)
 [ee78f7c6] Makie v0.24.8
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
Yes, it can be reproduced
  • What platform + GPU are you on?
Archlinux in WSL, GPU is Nvidia RTX3060
  • Which backend are you using? (GLMakie, CairoMakie, WGLMakie, RPRMakie)
CairoMakie
  • Please provide an minimal example of the failing code. If the problem is with the visualization, please provide a picture or video of it.
using CairoMakie

x = range(0, 2π, 100)
fig = Figure(; size = (400, 300))
ax = Axis(fig[1, 1], xlabel = "x")
lines!(x, cos.(x), color = :black, label = "cos(x)", linewidth = 1.25, linestyle = :dash, linecap = :round, joinstyle = :round)
axislegend(ax)
fig
save("legend_example.pdf", fig)

Hello Makie developers,

When plotting with CairoMakie, I noticed that if I specify a line style including the linecap attribute inside lines!(...), the legend does not display the corresponding linecap. In other words, the line segments shown in the legend ignore the linecap I set for the plotted lines. Is this a bug? If anyone can help me to solve this problem?

Thank you.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions