Skip to content

Bar width in BarPlot is decreasing with increasing xmin #35

Open
@ma3xxx3

Description

Describe the bug
Bar width in BarPlot is decreasing with increasing xmin of graph, even when xmin - xmax range is constant:
BarPlot

To Reproduce
Update xmin and xmax and BarPlot points range in example code in main

#............
            graph = Graph(
                xlabel='Cheese',
                ylabel='Apples',
                x_ticks_minor=5,
                x_ticks_major=25,
                y_ticks_major=1,
                y_grid_label=True,
                x_grid_label=True,
                padding=5,
                xlog=False,
                ylog=False,
                x_grid=True,
                y_grid=True,
                xmin=150,   
                xmax=200, 
                ymin=-1,
                ymax=1,
                **graph_theme)

#............

            plot = BarPlot(color=next(colors), bar_spacing=.72)
            graph.add_plot(plot)
            plot.bind_to_graph(graph)
            plot.points = [(x, .1 + randrange(10) / 10.) for x in range(150, 200)]

#............

Expected behavior
Bar width should be constant if xmin - xmax range is not changing.

Platform (please complete the following information):

  • OS: windows 11
  • Python 3.10.9
  • git commit: 27c93e0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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