I can’t seem to get the bar chart to label the x-axis to only 2 decimal places. Rounding the float value to 2 decimals still prints the full precision float. (Rounding to integer give me unintended consequences, such as values in same integer bin giving me > 100% results)
Here’s my code and my output. Thanks very much in advance!
Cat
The formatting of axis tick labels is controlled by the Axis model's TickFormatter, which is available as the .formatter attribute on an Axis, e.g:
myaxis.formatter
Once you have ahold of the axis you want to style, you can either configure the existing formatter, or replace it with a different one entirely, as described in the User's Guide here:
It's currently a little harder to get the axis you want to modify on Charts, since they don't have convenience properties like .xaxis that Figure models do. But you can use the .select method described here:
I can't seem to get the bar chart to label the x-axis to only 2 decimal places. Rounding the float value to 2 decimals still prints the full precision float. (Rounding to integer give me unintended consequences, such as values in same integer bin giving me > 100% results)
Here's my code and my output. Thanks very much in advance!
Cat