spotify/chartify

Log axis breaks bar plots

cphalpert opened this issue · 2 comments

Example:

import pandas as pd
import numpy as np
import chartify
df = pd.DataFrame({'values': [1000, 10, 100, 20]})
df['labels'] = df['values']


# breaks
ch = chartify.Chart(x_axis_type='categorical', y_axis_type='log')
ch.plot.bar(df, 'labels', 'values')
ch.show()

# works
factors = [str(x) for x in [1000, 100, 10, 1]]
ch = chartify.Chart(x_axis_type='categorical', y_axis_type='log')
ch.plot._set_categorical_axis_default_factors(True, factors)
ch.figure.vbar(x=factors, top=[1000, 100, 10, 1], bottom=0.1, width=1, fill_color='blue')
ch.show()

Related to:
bokeh/bokeh#6671
bokeh/bokeh#6536

Just an FYI, @birdsarah is planning to take a look at the Bokeh issue soon

@cphalpert, this is coming along nicely. (I'm so glad you raised it as I face this problem all the time). If you have any API opinions or other thoughts, bokeh/bokeh#8569 would be a great place to give me your feedback.