X Tutup
Skip to content

Bars object does not respect min or max of x-LinearScale correctly #880

@andymcarter

Description

@andymcarter

Describe the bug
When using the Bars object together with a LinearScale, the min and max attributes of the scale does affect the chart plotting areas, but the precise min and max values are not respected.

The behaviour appears to be correct for a y-axis LinearScale.

To Reproduce
import bqplot as bqp
x_sc = bqp.LinearScale(min=0)
y_sc = bqp.LinearScale()
ax_x = bqp.Axis(scale = x_sc)
ax_y = bqp.Axis(scale = y_sc, orientation='vertical')

bars = bqp.Bars(x = [10,12,14], y = [10,12,14], scales={'x': x_sc, 'y': y_sc})

fig = bqp.Figure(marks = [bars], axes = [ax_x, ax_y,])
fig

Expected behavior
The chart x axis should start from 0.

Screenshots
image

Environment (please complete the following information):

  • macOS, Chrome, bqplot 0.11.5

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup