Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bar and interval charts not aligning correctly #114

Open
wtn20 opened this issue Jul 28, 2020 · 1 comment
Open

Bar and interval charts not aligning correctly #114

wtn20 opened this issue Jul 28, 2020 · 1 comment

Comments

@wtn20
Copy link

wtn20 commented Jul 28, 2020

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

type: bug

type: feature

What happened:
When plotting a bar and associated interval chart with three categorical levels, the intervals do not align correctly.

Screen Shot 2020-07-28 at 1 42 13 PM

What you expected to happen:
They should align

How to reproduce it (as minimally and precisely as possible):

import pandas as pd
import chartify

example_data = pd.DataFrame(
    list(zip(
        ['a', 'a', 'a', 'a', 'b', 'b', 'b', 'b'],
        ['A', 'A', 'B', 'B', 'A', 'A', 'B', 'B'],
        ['c', 'd', 'c', 'd', 'c', 'd', 'c', 'd'],
        [1, 2, 3, 4, 5, 6, 7, 8],
        [v + 0.1 for v in [1, 2, 3, 4, 5, 6, 7, 8]],
        [v - 0.1 for v in [1, 2, 3, 4, 5, 6, 7, 8]]
    )),
    columns=['cat_1', 'cat_2', 'cat_3', 'val', 'upper', 'lower']
)

ch = chartify.Chart(blank_labels=True, x_axis_type='categorical')
ch.plot.bar(
    data_frame=example_data,
    categorical_columns=['cat_1', 'cat_2', 'cat_3'],
    numeric_column='val'
)
ch.plot.interval(
    data_frame=example_data,
    categorical_columns=['cat_1', 'cat_2', 'cat_3'],
    lower_bound_column='lower',
    upper_bound_column='upper',
)
ch.show('png')

Anything else we need to know?:

@metehankutlu
Copy link

Is there any way we can find the metrics (like space between bars, bar width etc.) of the bar chart? I found interval gets these values from style.py but couldn't find the metrics for bar chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants