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

axes.boxplot does not have zorder kwarg #7171

Closed
Labels
Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew feature
Milestone
@nancysendoh

Description

@nancysendoh

Hi eveybody,

I want to draw boxplot and scatter in one figure, but the boxplot always covers the points as below:
1

How could I set the scatter above the boxplot? Thanks ~

Here's my code:

import matplotlib.pyplot as pltimport numpy as npx=[1,2,3]a=np.array([70,170,130])y=[]yy=[]for i in range(3):    yy.append(np.random.randn(5))    y.append(yy[i].mean())plt.figure()fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(5, 5))axes.scatter(x,y,c='r',s=a)bplot1 = axes.boxplot(yy,                     vert=True,   # vertical box aligmnent                     patch_artist=True)   # fill with colorcolor = 'blue'for patch in bplot1['boxes']:    patch.set_facecolor(color)    patch.set_alpha(0.5)plt.savefig('1.jpg',dpi=100)plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp