You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
geom_segment with discrete y-axis and NA values #523
See the below examples. If there are None values present in the key column of the dataframe, the y-axis of the plot is extended by numeric values (1, 2, 3) in addition to the expected expected entries ('foo', 'bar', 'bazz').
If the None-value is converted to a string everything works as expected.
Sample code to reproduce
data = pd.DataFrame(dict(
key=['foo', 'foo', 'bar', None, 'bazz'],
start = [pd.Timestamp(x) for x in ['2021-01-01', '2021-02-01', '2021-03-01', '2021-04-01', '2021-05-01']],
end = [pd.Timestamp(x) for x in ['2021-01-15', '2021-02-15', '2021-03-15', '2021-04-15', '2021-05-15']],
color = ['arg', 'brg', 'brg', 'zrg', 'arg'])
)
aes = {
'x': 'start', 'xend': 'end',
'y': 'key', 'yend': 'key',
'color': 'color',
}
plot = p9.ggplot(data, p9.aes(**aes))
plot += p9.geom_segment(size=6, alpha=0.7)
plot
Activity
Fix discrete position scales for None values