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

  • SEARCH
  • Home
  • 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 8540805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:41:11+00:00 2026-06-11T11:41:11+00:00

I have about 15 series which I wish to scatter plot against a series

  • 0

I have about 15 series which I wish to scatter plot against a series of values of X.

However, for some values in my series I don’t want anything to be plotted. Is there a value I can use as a dummy, so that series lengths are the same, but matplotlib won’t plot that point?

For example if I have [1,2,3,4,5,6,7,8,9] as my x axis, and I have a series on the Y axis ['a', 'b', 'c', 'd', 'e', foo, 'g','h','i'] and I don’t want to plot foo against 6, I’d like to replace foo with some value that won’t be plotted.

I should point out that my x and y values are datetimes. I wasn’t expecting that to be necessary info, but it seems that whilst a NaN works for plotting floats, it doesn’t work for datetimes.

  • 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-11T11:41:12+00:00Added an answer on June 11, 2026 at 11:41 am

    So to solve this, I used Nones as dummy values, and created

    def find_indices(haystack, needle):
      return [i for i,x in enumerate(haystack) if needle == x]
    
    def remove_at(xs, indices):
      return [x for i,x in enumerate(xs) if i not in indices]
    

    And then

    nones_at = find_indices(y_values, None)
    x_values = remove_at(x_axis, nones_at)
    y_values = remove_at(y_values, nones_at)
    pyplot.plot(x_values, y_values)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a series of questions about Keys, Indexes and Constraints in SQL, SQL
i have about 20 possible exception messages that i want thrown when an error
So I have this code in python that writes some values to a Dictionary
I have a naive question about RSS feeds. I have a series of timed
I have a series of databases, each of which is basically standalone. It initially
I have a web site with a series of Master Pages which all derive
I have a SurfaceView which is currently drawing a series of Bitmaps. These bitmaps
I have a series of XML files which can be retrieved, edited and saved
First Value: I have a binary value which is actually a compact series of
I've got a situation where I have a series of member functions which produce

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.