Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Feature Request: multiple stacked bars #14086

Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
@busiing

Description

@busiing
Issue body actions

Summary

I am looking for a one-call way to plot multiple stacked bars in one chart by giving it a 2D-Matrix for the y-axis.

This feature request is similar to #11048, where the bars are placed next to each other.

The documentation for matplotlib.pyplot.bar just allows scalar or array-like inputs.

The data used contains 2 x 8760 timesteps (hours). ATM I work with stackplot to generate the following graphs. Just the third graph is relevant to this issue.

Figure_1

My workaround would be to use stackplot for a lineplot:
`ax1.stackplot(x,y, labels=labels)
and duplicate the data in 'y' - shift the duplication just a second before the next timestep (hour) and merge those sets.

Expected outcome
I found a function that fits my problem but is not scalable for bigger arrays. (creation time is long and editing the view takes forever) But the bars in this case have a gap between the bars. I am looking for a way to adjust the width, so the gaps can be closed.
I think the value and x-axis labels are responsible for the long calculation, but I am not sure.

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.03
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version: 3.6.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.