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
5 votes
1 answer
386 views

I have been working on a project for some time and have let one Python file grow into a huge file that tries to do everything. The structure is pretty flat, and I don't like it. I've used other ...
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 ...
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 ...
2 votes
0 answers
114 views

Recently I posted an answer on a question about Bézier curve calculations. As a micro-synopsis: there are three implementations of De Casteljau's algorithm here, including the original poster's, AJ ...
3 votes
1 answer
66 views

I have been working on some code that produces a live graphic of a graph and blocks moving. It works in theory but does not look like how I want. The animation runs very slow when showing both the ...
4 votes
1 answer
88 views

I defined a function that generates tables and creates countplots and barplots based on the arguments that it receives. But the snippets of code inside the function are repeated several times, which ...
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 ...
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 ...
2 votes
1 answer
124 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. ...
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=...
5 votes
1 answer
152 views

The idea is that I have a subset of the movements of material of a factory (over 700k rows), and I want to separate these movements by the reference of each product to plot the stock of each product ...
3 votes
1 answer
98 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 ...
6 votes
1 answer
159 views

I did an OOP to make the 2048 game using Matplotlib visualization. The color dictionary is for setting different colors to each number in the game. There are two ...
6 votes
1 answer
1k views

I have made a 3D mesh. See below: And the code below: ...
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}...
4 votes
1 answer
361 views

I have written an error analyzer in Python for the product of our company. I want to read the log from our device and parse it, On Y axis there are different components of the device, and on X axis ...
4 votes
1 answer
4k views

This is my implementation of pricing an exotic option (in this case an up-and-in barrier option) using the Monte Carlo simulation in Python. I use NumPy where I can. Any ideas to optimize this code? <...
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 ...
1 vote
1 answer
118 views

I am new to Python, so I am interested in knowing if I am efficiently using Python for this project. This program is meant to simulate the Central Limit Theorem. It uses sliders to adjust the number ...
4 votes
0 answers
586 views

The tweepy.models.Status class creates a 'tweet' object, it has attribute .created_at which is the posting time of the tweet in ...
5 votes
1 answer
313 views

I wrote a program for analyzing pictures. The problem I'm having is very slow processing time for medium images like 800x800. I think the root of the problem for this is the ...
4 votes
1 answer
2k views

I wanted to create a histogram from a list of positive integers. I want to bin it so that I show all single numbers, say K through N, with more than k elements in the data set, as well as the number ...
4 votes
1 answer
2k views

The idea is exploratory data analysis, the output rendered as a histogram to get an idea of relative frequency of records: The example data set looks like this: ...
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,...
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 ...
5 votes
1 answer
131 views

I want to use Python and Matplotlib to create a data set of images. I want to do this by transforming the plot to a numpy matrix. At the moment it takes about 0.1 second to generate 100 images of size ...
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 ...
4 votes
1 answer
211 views

I have a stream of sensor data which I want to visualize in a plot with many subplots. Plotting the data is a real bottleneck in my code. Right now I get with small resolution only 16 FPS which is far ...
3 votes
1 answer
121 views

Given a class BasicDataFeed whose purpose is to feed questions and answers into an artificial neural network, which is tested in a non-negotiable manner as follows: ...
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 ...
3 votes
1 answer
126 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 &...
3 votes
1 answer
154 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: ...
4 votes
3 answers
761 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 ...
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 ...
4 votes
2 answers
372 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 ...
1 vote
1 answer
118 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 ...
2 votes
2 answers
3k views

I am trying to make a 3D grid plot in Python using Matplotlib. The grid consists of hexahedral cells (with qudrilateral surfaces). The surfaces should be colored according to their height, that is: ...
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 ...
2 votes
1 answer
91 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 ...
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 ...
3 votes
1 answer
87 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 ...
7 votes
2 answers
633 views

I have a csv file that looks like this: ...
2 votes
1 answer
252 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 ...
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 ...
1 vote
1 answer
65 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 ...
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 ...
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 ...
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 ...
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 ...
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 ...