bar_chart_race icon indicating copy to clipboard operation
bar_chart_race copied to clipboard

X-Axis to include nagative values. It follows that "fixed_min" will be good to have.

Open sgangal opened this issue 4 years ago • 2 comments

Hi Ted,

Very good API ... Thanks a lot !!

I would request that you permit X-Axis to include negative values as well. If you were to include then it follows that the "fixed_min" will be good to have just like you have "fixed_max".

The use case where say I'm plotting return of a group of stocks, and some of them have negative return that I'd like to plot. (In case of Covid deaths and Home Runs it's all expressed as positive X-Axis values, however there are instances of negatives as well.) Another use case could be where we're plotting the Average Temperatures of Chicago, Houston, San Francisco, Los Angeles etc. recorded on Jan1, Feb 2, Mar 1, etc.

Thanks. ~ Salil

sgangal avatar Nov 30 '20 05:11 sgangal

is there any way to achieve this? E.g. through normalizing the data and then changing the bar values?

haemi avatar Jul 20 '21 19:07 haemi

I did something similar: My data was time stamp, I modify to numeric and then the label back to time. But I did this in the module original code .

My code is at https://github.com/bzimons/MCspeedrun , check it out the code _make_chart.py at bar_chart_race2 folder around line 376 to 384

Maybe you can add the positive number to your data and then subtract it in this part of the original module.

Hope it can help you make the modifications to get what you wanted :)

bzimons avatar Jul 22 '21 17:07 bzimons