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 7691011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:31:39+00:00 2026-05-31T20:31:39+00:00

I am using matplotlib and I’m finding some problems when trying to plot large

  • 0

I am using matplotlib and I’m finding some problems when trying to plot large vectors.
sometimes get “MemoryError”
My question is whether there is any way to reduce the scale of values ​​that i need to plot ?

enter image description here

In this example I’m plotting a vector with size 2647296!

is there any way to plot the same values ​​on a smaller scale?

  • 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-05-31T20:31:41+00:00Added an answer on May 31, 2026 at 8:31 pm

    It is very unlikely that you have so much resolution on your display that you can see 2.6 million data points in your plot. A simple way to plot less data is to sample e.g. every 1000th point: plot(x[::1000]). If that loses too much and it is e.g. important to see the extremal values, you could write some code to split the long vector into suitably many parts and take the minimum and maximum of each part, and plot those:

    tmp = x[:len(x)-len(x)%1000] # drop some points to make length a multiple of 1000
    tmp = tmp.reshape((1000,-1)) # split into pieces of 1000 points
    tmp = tmp.reshape((-1,1000)) # alternative: split into 1000 pieces
    figure(); hold(True)         # plot minimum and maximum in the same figure
    plot(tmp.min(axis=0))
    plot(tmp.max(axis=0))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using matplotlib and numpy to make a polar plot. Here is some
I am running Mac OSX 10.5.8. I installed matplotlib using macports. I get some
I need to get a plot that fits the data automatically using matplotlib. This
I am using matplotlib.pyplot.scatter to draw some simple scatter plot. However, something wrong appears
I'm using Matplotlib to plot a histogram. Using tips from my previous question: Matplotlib
I am trying to make a contour plot of the following data using matplotlib
I need to plot some data in various forms. Currently I'm using Matplotlib and
I'm trying to generate a plot using Matplotlib with a non-Latin character (a μ)
I'm trying to show a contour plot using matplotlib from a complex array. The
I have a bunch of points that I am trying to plot using matplotlib.

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.