Skip to content

[ENH]: Make it so that linestyle works the same way as color when plotting several bars, lines, scatter points, etc. #23222

Description

@AndreasBugten

Problem

Hello!

I am trying to plot a series of bars within a bar plot, and I want each bar to have its own color and linestyle. I intend to achieve this by using a list of colors, and a list of linestyles, and then simply plot the bars and set the color and linestyle to their respective lists. This works for color, but not for linestyle, since the linestyle function does not recognize a list as input.

Below I have two code snippets, and their respective outputs, which highlights the problem.

First, without using linestyle:
image

Then, using linestyle:
image

I have checked that all of the linestyles are compatible with the plt.bar function.

Proposed solution

No response

Activity

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

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