Skip to content

geom_segment with arrow in facet_grid produces strange arrow heads #388

@mnicstruwig

Description

@mnicstruwig

Reproducible example (plotnine == 0.6.0):

from plotnine import *
import pandas as pd


df = pd.DataFrame({
    'x': [1, 2],
    'xend': [3, 4],
    'y': [10, 10],
    'yend': [9, 9],
    'facet': ['a', 'b']
})

p = ggplot(aes(x='x', xend='xend', y='y', yend='yend'), df)
p = p + geom_segment(arrow=arrow()) + facet_grid('~ facet')
print(p)

which produces the following plot with weird arrow heads:
Figure_1

The issue also occurs when using annotate instead of geom_segment directly.

If facet_grid is not used, the issue disappears (which makes me suspect it's got something to do with the axes' scale, but I'm very unfamiliar with the internals of plotnine).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions