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
6 votes
2 answers
124 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
460 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
3 votes
1 answer
120 views

Based from the source code of the TwoSlopeNorm color normalization of matplotlib, I tried to implement a more general normalization that can handle any number of &...
mocquin's user avatar
  • 133
3 votes
1 answer
152 views

I have tried to improve my code with the suggestions I recieved in my old question about Collatz conjecture Here is the new code: ...
Lorenzo's user avatar
  • 157
4 votes
3 answers
758 views

I am writing a program to display the behavior or certain seeds when you apply the Collatz conjecture algorithm to them. I would like to know what I should change and also if there is a way to see ...
Lorenzo's user avatar
  • 157
4 votes
2 answers
370 views

I have implemented a class in Python using Matplotlib for visualizing multiple subplots along with navigation buttons to move between different subsets of data. Each subplot displays a contour plot ...
Cold Fire's user avatar
1 vote
1 answer
117 views

So I have a large application that I've been writing. One part of that application is responsible for displaying images taken from a camera and plotting two graphs. I've successfully stripped out the ...
Michael's user avatar
  • 303
2 votes
1 answer
90 views

I've developed a Python script that simulates die rolls and analyses the results. I'm now looking to extend and modify this code for more complex data science tasks and simulations. Is this code ...
Attila Vajda's user avatar
2 votes
1 answer
121 views

I am implementing Simulated Annealing to the Travelling Salesman Problem, plotting a graph of temperature (x axis) and cost (y axis) and animating using cv2. ...
PuzzleheadedSoup-98's user avatar
1 vote
1 answer
58 views

I would like to improve the overall look and feel of the two log graphs generated by the Python code below. The first graph represents the optimized methods while the second graph represents the ...
Ruan's user avatar
  • 111
3 votes
1 answer
86 views

The following code simulates the (simplified) concept of evolution of cells. They can reproduce, grow older and have a fitness which modifies their chance of survival. Using matplotlib, graphs are ...
Dornteufel's user avatar
7 votes
2 answers
632 views

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

I try to plot the correlation matrix of a Pandas DataFrame. As the diagonal elements are always ones, and the matrix is symmetrical, so I can get rid of most than a half of the squares without loosing ...
Arpad Horvath's user avatar
1 vote
1 answer
172 views

Preface: Before anyone suggest using pandas, no I don't want to use pandas, only pure python please. The concept of my code is quite simple, given some list of strings in a text file formatted as such ...
samman's user avatar
  • 491
1 vote
1 answer
64 views

This is a fun exercise that tries to answer the following question: if the elements from a square matrix are randomly chosen from 0 to 9, is it more like that the determinant would be even or odd? I'm ...
Maxwell's Daemon's user avatar
1 vote
1 answer
125 views

I'm at the end of the IBM Data Analyst course, and I wanted to ask for a rating of a piece of code I wrote as a solution to its exercises from the final chapter. I know I could write it on the forum ...
kkkkrkrkkk's user avatar
1 vote
1 answer
119 views

I use the following code to identify some interested values into a dataframe and them plot a time window before and after that value appeared. It works very well, but I would like to know if there is ...
GregOliveira's user avatar
3 votes
0 answers
101 views

If you would like to download some grib data for yourself, the script below will pull girb data from the google api over a date range at an hourly interval. Extract some hrrr grib2 data ...
Jason Leaver's user avatar
2 votes
0 answers
835 views

I wrote the scripts several days ago, they do exactly what I intended, but the performance is not very good, I am still stuck on for loops and don't know how to vectorize things, I wrote both scripts ...
Ξένη Γήινος's user avatar
3 votes
1 answer
1k views

I needed to create a bar plot that show: the mean from some series; them 95% confidence interval; and, bars might be colored blue if they are definitely above this value (given the confidence ...
GregOliveira's user avatar
6 votes
0 answers
153 views

I have written a simple Python script that generates n-flakes using matplotlib. Wikipedia article on N-flake. I wrote two functions, one function generates pentaflake, the other generates hexaflake, I ...
Ξένη Γήινος's user avatar
1 vote
0 answers
336 views

These are what I was working on in the last few days, I wrote a bunch of functions that fill a given region with rectangles of different colors. The functions can: Randomly split a region into sub ...
Ξένη Γήινος'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
7 votes
1 answer
242 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
2 votes
1 answer
190 views

The following code is a conversion from some old java I wrote to python. It shows the beginnings of a simulation of an ant colony. I am finding the animation speed very slow - and I'm wondering if I ...
Konchog's user avatar
  • 355
2 votes
0 answers
117 views

The code below plots a background image (sky) and then a Gundam sprite using Matplotlib. It also creates 4 buttons with obvious purposes. The Gundam class stores 2 ...
Redsbefall's user avatar
  • 1,212
2 votes
1 answer
3k views

Task I tried to code a treemap function in matplotlib, and one of the challenges is auto-fitting text into boxes of different sizes in the treemap, similar to R's package ggfittext. My Code My ...
Z-Y.L's user avatar
  • 163
4 votes
1 answer
184 views

I would like to model global warming from temperature records recorded daily from June 1920 to October 2019 in Montélimar on Python. To do this, I would first like to model these seasonal variations ...
Donny's user avatar
  • 41
6 votes
1 answer
416 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
3 votes
1 answer
257 views

I have an assignment where I write a Collatz Conjecture program for a series of starting values from 1 to N and make two plots: number of iterations vs starting value and computed numbers vs starting ...
Dila's user avatar
  • 215
4 votes
1 answer
445 views

I have completed my project which simulates the path of a particle trapped in a device known as a magnetic mirror. I would like your thoughts and improvements on my implementation. Here is the code: <...
Dila's user avatar
  • 215
5 votes
1 answer
3k views

The program is designed to take data from a MySQL database, using mysql-connector-python, and print it as a table in Python using the texttable module. The program also plots charts based on the data ...
Random Person's user avatar
2 votes
1 answer
99 views

I was struggling to make the RadioButtons widget look presentable. Either the circles were not round, or the frame had a totally wrong shape, or both (see pictures below, and also this question on SO)....
Yulia V's user avatar
  • 645
3 votes
1 answer
772 views

I was trying to implement my own version of matplotlib's hist function and I came up with this: ...
Amirhossein Rezaei's user avatar
1 vote
1 answer
120 views

I have been coding in Python for a number of years now. I've always felt that Matplotlib code takes up a lot more lines of code than it should. I could be wrong. I have the following function that ...
Ruan's user avatar
  • 111
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
1 answer
292 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
3 votes
1 answer
132 views

Dear coding black belts, My code is working but seems clunky. Take a random number from 1 to 99,999 Display it in 3D in a modified version of the Cistercian numerals from 13th century monks (adding ...
Jelaludo's user avatar
2 votes
1 answer
77 views

I have been playing around with numpy and matplotlib. My little project was to create a scatter plot ranging from -1 to 1 on both X and Y, but where the shading is done with the XOR scheme. The ...
GalacticPonderer's user avatar
4 votes
0 answers
601 views

this is my very first pandas/matplotlib code and I would be grateful if you can review my code and share your thoughts or ideas for improvement. Please focus on code, not the features of resulting ...
Jaroslav Hradský's user avatar
3 votes
1 answer
138 views

I have some code that manipulates a Pandas Dataframe containing Covid-19 vaccine data and displays it on Matplotlib. The data is here: https://covid.ourworldindata.org/data/owid-covid-data.csv (...
KetZoomer's user avatar
2 votes
0 answers
1k views

I am computing shortest paths of graphs using Python Networkx and Matplotlib. I'm focused on animating the route inspection problem path in particular here. My goal is to smoothly render such ...
Richard's user avatar
  • 57
1 vote
1 answer
369 views

I'm new to data science. I wrote this script for plotting all different kinds of iris data set scatter plot. trying not to plot something with itself . how can I optimize my code ? ...
vhd's user avatar
  • 13
2 votes
2 answers
135 views

So this is a project I have been working on for the last few weeks. Just started learning Python. Started out with bash scripting and got the itch to learn more. Anyway code fetches covid-19 data from ...
drebrb's user avatar
  • 137
2 votes
1 answer
85 views

This is code for a measurement setup that receives a steady stream of UDP data, finds the trigger in one channel and operates on the data in the other channel to enhance the signal and remove noise, ...
Andreas Schuldei's user avatar
3 votes
1 answer
97 views

I have code here for predicting temperature across months. This is the dataset that I was using: https://www.kaggle.com/sumanthvrao/daily-climate-time-series-data I used a SARIMA model, and looking at ...
Jasper Tan's user avatar
1 vote
0 answers
44 views

I've written a working and complete proof of concept that shows a spectrograph in Matplotlib. I want to nail down this proof of concept before I continue with development, and I'm not thrilled with ...
Reinderien's user avatar
  • 71.2k
1 vote
1 answer
134 views

I am fairly new to Python and have tried to create a tic tac toe game that is completely automatic, where you can see if a player1 has an advantage if you let it ...
Ida's user avatar
  • 11
1 vote
1 answer
87 views

I am a self-learned programmer and this is my first program. I would really appreciate any critique on my approach. The program should automatically download the who data file to the folder these ...
AgentJRock's user avatar
1 vote
1 answer
226 views

Dear Python VIS community. Imagine the following situation: You ran an experiment in an earth system model (ESM) where you altered some input parameters relative to a control run of the same ESM. Now ...
oddquestionoddanswer's user avatar