Skip to main content

Questions tagged [matplotlib]

Matplotlib is a plotting library for Python, built on NumPy and often used interactively with IPython. Its compact "pyplot" interface is similar to the plotting functions of MATLAB®.

Filter by
Sorted by
Tagged with
18 votes
1 answer
7k views

When writing Code Review answers, it becomes often necessary to measure how long the modified code takes vs how long the OP's code takes. I needed a nice way to visualize this as a function of the ...
Graipher's user avatar
  • 41.7k
15 votes
3 answers
5k views

I have written a simple program to do trajectory simulation in the Earth-Moon system, it still has a long way to go I am working on making it more class oriented and am looking into implementing a ...
Mark Omo's user avatar
  • 449
15 votes
1 answer
1k views

My Racetrack is just that. A Racetrack. You can't race it (yet) because I had trouble with collision detection, but I wanted to share it anyway. It creates a base polygon by using ...
Mast's user avatar
  • 13.9k
15 votes
1 answer
6k views

I've create a simple interface for viewing a time-series as it changes over time in matplotlib. You can pause, reset or click/drag on the time-line to change the view. Have I used the matplotlib API ...
Seanny123's user avatar
  • 1,617
14 votes
2 answers
3k views

The past week I have tinkered making a sound visualizer using Tkinter, Matplotlib, NumPy, PyAudio and using a thread to be able to play the sound and to display the plot at the same time. I have been ...
Bruno Vermeulen's user avatar
14 votes
1 answer
12k views

I am learning Python and I tried to do a program to find K points from a set of N points, farthest as much as possible (I'm not ...
Sigur's user avatar
  • 307
13 votes
2 answers
1k views

I am trying to replicate Bruce B. de Mesquita's (BDM) results on political game theory for prediction. Based on where actors stand on issues, their capabilities, salience, BDM's method attempts to ...
BBSysDyn's user avatar
  • 231
13 votes
1 answer
1k views

Our quest: Create a big simulation for Conway's Game of Life, and record the entire simulation history. Current Approach: Cython is used for an iterate method. The ...
Paul's user avatar
  • 475
13 votes
1 answer
1k views

NOTE: See follow up to this question here I created a simple python script to plot quadratic, cubic and quartic polynomials with integer coefficients between -4 and 4. It uses numpy to find the roots ...
Linus's user avatar
  • 937
12 votes
3 answers
642 views

For a university assignment I had to plot different polynomial functions depending on one single parameter. That parameter gave the number of supporting points to interpolate a given function in the ...
Vogel612's user avatar
  • 25.5k
12 votes
1 answer
12k views

This program displays either the time, current temperature, 12hr graph of temps, 24 hr graph of temp or a week's graph of temps. Selection is based on user input of one of the GPIO pins. Please ...
Mwilliams03's user avatar
12 votes
1 answer
9k views

I'm creating a rectangular prism function, whose output looks like this: I think that this code can be improved by optimizing the use of np.meshgrid with a Python ...
Seanny123's user avatar
  • 1,617
12 votes
1 answer
5k views

I made a random-walk predator-prey simulation that focuses on individual animals instead of the (maybe) more common array-based approach. I'd like to hear your opinion about this: how could the ...
Neinstein's user avatar
  • 405
12 votes
1 answer
889 views

I want to have someone reviewing and helping me get some good ideas in how to improve my current project. All information about the project is in the following github link. I would also appreciate ...
Edvardsson's user avatar
11 votes
1 answer
3k views

There is a type of diagram summarizing how well predictions from numerical models fit expectations; one obvious use case is comparing machine-learning regression models. Modified Taylor diagrams are ...
Laurence Billingham's user avatar
10 votes
2 answers
4k views

Below is a simple random walk predator prey simulation that is optimized to the best of my abilities. I would love to hear about any improvements that can made. ...
Paul's user avatar
  • 475
10 votes
1 answer
340 views

This is the a bit of code that works with Echonest API's pyechonest and remix libraries combined with matplotlib.pyplot to offer a simple visual representation of the start and end "parts" of a music ...
MikeiLL's user avatar
  • 640
10 votes
1 answer
122 views

In order to avoid having to make any real progress (at least for a short time), I wrote a script that measures how much progress I have made so far, instead. Specifically, this script sums up the file ...
Graipher's user avatar
  • 41.7k
8 votes
3 answers
878 views

This is my first script that I've written. As a result, I'm sure there are extra lines that are unneeded, or maybe better more concise ways of doing things than I have done here. I have tried to add ...
samman's user avatar
  • 491
8 votes
2 answers
2k views

I have written a program that divides an geographical area up in cells with size 0.002 degrees longitude by 0.001 degrees ...
bjornasm's user avatar
  • 417
8 votes
2 answers
13k views

I'm teaching myself Python and when a friend posted this sentence Only the fool would take trouble to verify that his sentence was composed of ten a's, three b's, four c's, four d's, forty-six e's,...
Dan's user avatar
  • 615
8 votes
1 answer
159 views

Recently, I became very interested in a probability practice problem in my textbook for my class. I decided to implement it in code and I think I got most of it implemented. Right now, I'm hoping to ...
Duke0200's user avatar
  • 115
8 votes
1 answer
1k views

I would like to have some insights on the code I created. It would be really insightful for me to get some feedback about the code, what I should do differently, if there is an easier, more elegant ...
Gábor Erdős's user avatar
7 votes
1 answer
2k views

Here is the code as it stands right now: ...
bzm3r's user avatar
  • 399
7 votes
3 answers
328 views

I am not much experienced in Python, just write some small script. All my codes are procedural. They work fine, and I always check them with pep8. One of them is: ...
BaRud's user avatar
  • 207
7 votes
2 answers
633 views

I have a csv file that looks like this: ...
Fang's user avatar
  • 617
7 votes
1 answer
830 views

The script below is used to determine relay operating times, as defined in the standard IEC 60255. The equation and relevant information can be found here. ...
Stewie Griffin's user avatar
7 votes
1 answer
300 views

For plotting I often use a dictionary that contains my data of interest, regarding my numerical simulations. For example I have a numpy array - let's call it ...
Lin's user avatar
  • 357
7 votes
1 answer
143 views

I would like to share a matplotlib real-time monitor plot that I needed for another application. The basic trick is to reverse the time, so that t=0 is now and t=...
Bruno Vermeulen's user avatar
7 votes
1 answer
697 views

Double Pendulum I made a little application that embeds a matplotlib dynamic plot into tkinter that enables control through the ...
Bruno Vermeulen's user avatar
7 votes
1 answer
137 views

I have written a python function that outputs scatter plots using Matplotlib after processing the data a little. It works but it's painfully slow. I was wondering if anybody had any suggestions as to ...
CiaranWelsh's user avatar
7 votes
1 answer
9k views

I've got some time-series data. I want to examine the weekly and daily variation of that data. For weekly data I can make a plot like this, with the days along the horizontal axis: For daily data I ...
BlandCorporation's user avatar
7 votes
1 answer
246 views

I am always super interested in both science and art, science and art are two different ways to describe the objective reality, they are two sides of the same coin, in many areas they overlap, and ...
Ξένη Γήινος's user avatar
7 votes
1 answer
173 views

I have a program that uses pandas to read csv files and then generates and saves graphical charts. I have been trying to follow the SOLID principles so I have tried to seperate responsibilities. So ...
JudasMoses's user avatar
6 votes
2 answers
3k views

I have a very simple Python script. All it does is open two data files from a given directory, read the data, make a series of plots and save as PDF. It works, but it is very slow. It takes almost 20 ...
point618's user avatar
  • 113
6 votes
1 answer
461 views

I've written a Python script to solve a system of coupled differential equations and then use the results to solve an eigenvalue problem. The full problem is: \$\frac{d^2}{dr^2} K(r) = \frac{K(r)}{r^2}...
Amirhossein Rezaei's user avatar
6 votes
2 answers
149 views

I have implemented the following Markov chain Monte Carlo MCMC algorithm for the German tank puzzle found here. I just want to make sure everything is legit and that I am not getting the right answer ...
user2879934's user avatar
6 votes
1 answer
403 views

I computed a 2D vector field \$\mathbf{U} = (u(x,y), v(x,y))\$ with radial symmetry, parametrized as \$(u,v) = a(r) (x,y) + b(r) (-y,x)\$, where \$a(r), b(r)\$ are given as solution of an IVP which I ...
Max's user avatar
  • 211
6 votes
2 answers
129 views

I’ve written a small Python module to generate mock Slack workspace data, build a user–user interaction graph, and surface complementary collaborators based on skill sets. The key features are: Data ...
Bob's user avatar
  • 221
6 votes
1 answer
339 views

I've been doing a Udemy course called: "Statistics for Data Science" and I decided to solve one of the homework with Python to kill two birds with one rocket #elon. The task was: The team of ...
Mateusz Konopelski's user avatar
6 votes
2 answers
362 views

A covering array is an \$N \times k\$ array in which each element is a from a set of \$v\$ symbols, and for every \$t\$ columns, every possible set of \$v^t\$ choices of the symbols appears at least ...
Ryan Dougherty's user avatar
6 votes
1 answer
294 views

I'd like to plot an animation of Lissajous curves using Python and matplotlib's animate library. I really do not have a lot of experience with Python, so rather ...
pmpyt's user avatar
  • 61
6 votes
1 answer
700 views

I have created a visualisation of sorting algorithms using tkinter and matplotlib. Please let me know what you think and if you have any suggestions or find errors. The aim of this code is to create ...
MGedney's user avatar
  • 91
6 votes
1 answer
3k views

I decided to write a program to solve Tangram puzzles. This went a bit out of hand and I ended up with 600+ lines of code. I don't think it should have taken so much code. Here is an image of a ...
Jan Kuiken's user avatar
  • 1,523
6 votes
1 answer
882 views

My question concerns the following Python code which is already working. As far as I have seen, there are very elegant solutions of compacting code. Do you have any ideas on how to make the following ...
user3058865's user avatar
6 votes
1 answer
417 views

My code is working properly, but I am looking for better approach in the calculation of quantiles and the finding of the data in the dataframe. ...
cebep27's user avatar
  • 63
6 votes
1 answer
608 views

If you don't know what is Schelling's model of segregation, you can read it here. The Schelling model of segregation is an agent-based model that illustrates how individual tendencies regarding ...
Kartikeya Sharma's user avatar
6 votes
1 answer
3k views

I have a list of 2D arrays which comes from a time evolution PDE (in \$(x, y, t)\$) that I solved numerically. There are \$k\$ arrays, which all have the same dimensions, and the arrays correspond to ...
Matthew Cassell's user avatar
6 votes
1 answer
2k views

I have the following dictionary: ...
sheldonzy's user avatar
  • 471
6 votes
1 answer
1k views

I have made a 3D mesh. See below: And the code below: ...
riflab's user avatar
  • 61