Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:05:53+00:00 2026-06-07T15:05:53+00:00

I need to make a plot (with errorbars) with ellipses as markers. After some

  • 0

I need to make a plot (with errorbars) with ellipses as markers. After some searching I came up with Ellipse in matplotlib.patches. Then I could draw the error bars with plt.errorbar. But the problem is that even though I give the error bar command first, the error bars are always drawn in the foreground and the ellipses are drawn on the background, no matter what order I give in the program.

Does any one know of a better way to create an ellipse as a marker (each point will have a different eccentricity) with error bars? Or at least guide me in how to put the error bars in the background?

Here is a minimal example of what I have so far:

import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.patches import Ellipse

PlotFileName="test.pdf"
pdf = PdfPages(PlotFileName)
fig=plt.figure(1)
ax1=fig.add_subplot(111)
plt.xlim([1,4])
plt.ylim([2,8])
ax1.errorbar([2.5], [5], yerr=[1], fmt="o", color="black", ms=0.1)
ax1.add_artist(Ellipse((2.5, 5), 1, 1, facecolor="green", edgecolor="black"))
pdf.savefig(fig)
pdf.close()
plt.close()

and here is how it looks:
error bar infront of ellipse

I want the error bar to go in the background of the ellipse.

Thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:05:55+00:00Added an answer on June 7, 2026 at 3:05 pm

    Use the zorder specifier for both your plot commands.
    From the documentation: “Set the zorder for the artist. Artists with lower zorder values are drawn first.”

    import matplotlib.pyplot as plt
    from matplotlib.patches import Ellipse
    
    fig=plt.figure(1)
    ax1=fig.add_subplot(111)
    plt.xlim([0,5])
    plt.ylim([0,10])
    ax1.errorbar([2.5], [5], yerr=[1], fmt="o", color="black", ms=0.1, zorder=1)
    ax1.add_artist(Ellipse((2.5, 5), 1, 1, facecolor="green", edgecolor="black",zorder=2))
    
    plt.show()
    
    exit(0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need make some action (dump statistical data) before the Dart program ends. The
I need to make efficient d-dimensional points searching and also make efficient k-NN queries
I have plotted a contour map but i need to make some improvements. This
I need to make a plot that functions like a density plot for high-density
I need to make a distribution build for my application. Im using Core Plot
I've an image over which i need to plot some points. The problem is
I have this plot [ Full Resolution ] I need to make a straight
I'm getting back into working with R and I need to make a plot
I frequently find myself doing some analysis in R and then wanting to make
I need make all of my posts update. I use bulk upload for store,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.