bqplot documentation in Python

393 views Asked by At

I'm trying to develop some graphs using bqplot in Python but I'm having some questions regarding the documentation and where I can find the appropriate options to personalize a graph. I'm trying to make a boxplot graph and chenge the axes_options, but I don't find anywhere what's the possible options of 'axes_options' argument.

Here's a toy example of the boxplot that I want to change:

import bqplot.pyplot as plt
x = [1]
y = [[7,9,7,6,4,3,2,5,6,7,1,2,3,1,4.4,7.7]]
fig = plt.figure()
# add x and y labels using axes_options
axes_options = {'x': {'label': 'X'}, 'y': {'label': 'Variable Value'}}
boxes = plt.boxplot(x, y, box_fill_color='gray', outlier_fill_color='black', axes_options=axes_options)
fig

How can I, for example, change axes limits inside the axes_options dictionary? And how can I find the available options?

1

There are 1 answers

0
ac24 On

One way I achieve this is to access the Scale that the Axis is attached to once the figure has been instantiated, e.g. fig.axes[0].scale.min = 0, or fig.axes[0].scale.max = max(data).

I have come across some issues with boxplot generally, and as you highlighted on Github. But this method seems to work well for other chart types e.g. Scatter.