Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[New Feature] Insert color fill parameter to Boxplot instead of using 'patch_artist' #17959

Open
Labels
@lfenzo

Description

@lfenzo

Feature Request

I'm new to matplotlib and I don't know if there is a specific reason for the boxplot fill coloring to be the way it is. I only wonder if it could be done in a more straight forward manner than what is shown inhere.

The idea for this "new feature" would be to use acolor parameter that recieves either a list of supported colors or a single color (e.g.color = 'red') that specifies the colors to be applied to each one of the boxplots in the ax.

How it is currently done

importmatplotlib.pyplotaspltimportnumpyasnpdata= [np.random.normal(0,std,1000)forstdinrange(1,6)]box=plt.boxplot(data,notch=True,patch_artist=True)colors= ['cyan','lightblue','lightgreen','tan','pink']forpatch,colorinzip(box['boxes'],colors):patch.set_facecolor(color)plt.show()

The idea for this 'New Feature'

importmatplotlib.pyplotaspltimportnumpyasnpdata= [np.random.normal(0,std,1000)forstdinrange(1,6)]colors= ['cyan','lightblue','lightgreen','tan','pink']# or maybe 'c = colors', 'face_colors = colors'...plt.boxplot(data,notch=True,colors=colors)plt.show()

Any thoughts on this idea?

Matplotlib version

  • Operating system: Windows 10 2004
  • Matplotlib version: 3.2.2
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.7.7
  • Jupyter version (if applicable): 2.1.5
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp