Skip to content

Bar spacing shifting stacked plot off center #1542

@al-labs

Description

@al-labs

I’m having trouble adding bar spacing to a stacked plot, as it is shifting the bars off center.

dfsample = CSV.read("dfsample.csv", DataFrame) 
    p = plot(dfsample, 
    x=:Percent, 
    y=:LessonName, 
    color=:PassType,  
    Geom.bar(orientation = :horizontal), 
    Theme(  
        #bar_spacing=5mm  
    ) 
)

dataframe

You can see the plot displays as expected:
1

However when I add bar_spacing of 5mm it shifts the bars off center (down) from the axis labels:
2

When I remove the color attribute the bars are spaced and centered correctly:
3

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions