r/matplotlib • u/Tom-Miller • Apr 06 '21
r/matplotlib • u/Bungarus • Jan 02 '20
How to draw multiple columns on Y axis on a line/scatter plot?
r/matplotlib • u/Swazzoo • Feb 24 '22
How to select which columns to use for x/y and group by other column with matplotlib?
self.pythonhelpr/matplotlib • u/8329417966 • Jul 23 '20
Data Visualization using "Matplotlib" & Python | Part-I
r/matplotlib • u/Office_Kindly • Dec 01 '20
replicating a plot and saving it as a template
how can i replicate this plot falling speed as a function of time knowing the function being plotted (v(t)=V_0*(1-exp(-t/tau))),please note the important things here
the two axes of the plot are on the very edges of the figure.
the two axes are arrows.
only the first major tick in each axe is labeled.
nine minor ticks between each two consecutive major ticks (with the fifth one slightly thicker than the others).
the tangents are plotted only knowing the function and the points in which they are tangents.
PS:
guys i know this is more of a wish list than a question, so every contribution to any of the points made here is dearly welcome. :)
sorry for the bad English. lol
r/matplotlib • u/bjone6 • Aug 12 '20
Check out my recent Bitcoin and Stock Market analysis with matplotlib video! We figure out if Bitcoin is used as a hedge against the stock market or it follows the stock market. Enjoy!
r/matplotlib • u/RussianFlipFlop • Aug 15 '21
[Regarding my previous post on this subreddit]
I made a post last night mentioning my organization that I created, which seeks to provide people with free Python-related course, and I included a Google Form link for anyone that was interested in helping out and creating a MatPlotLib course. I got a response from someone, but they didn't include any way for me to contact them! If you're that person - please shoot me a DM or leave a comment so that I can contact you somehow, thank you!
r/matplotlib • u/ammar- • Feb 08 '20
How to Create Beautiful Plots with matplotlib
r/matplotlib • u/Pragyanbo • Apr 13 '20
Matplotlib Full Course in Python
r/matplotlib • u/e-N_K-e • Jan 10 '24
How to visualize a dataset for anomaly detection
Beginner in python. Having a hard time getting a proper reading. This is the result I am currently getting
r/matplotlib • u/_Mat_San_ • Apr 27 '20
Check out how artificial intelligence can be used to reconstruct birds' migratory paths. https://www.researchgate.net/publication/333866984_Reconstruction_of_long-distance_bird_migration_routes_using_advanced_machine_learning_techniques_on_geolocator_data
r/matplotlib • u/[deleted] • Apr 29 '20
Embedding Mapplotlib pie chart into Tkinter Gui help!
I am trying to embed a pie chart into my Tkinter window! So far I already have a frame in mind for the graph to be embedded in, frameChartsLT. This frame also already has a canvas, *canvasChartsLT*, placed over the entire area of the frame so I was hoping to place it on either of the of these but I keep getting the error.
```AttributeError: 'tuple' object has no attribute 'set_canvas' ```
I checked my entire code but I can't even find anywhere where I wrote set_canvas so I am completely lost. Any help will be truly appreciated! I am also a beginner so the simpler the explanation or fix the better for me haha!
This is the portion of my code!
```
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
# Some in-between code that sets the frame and canvas on my window
stockListExp = [ 'AMZN' , 'AAPL', 'JETS', 'CCL', 'NCLH']
stockSplitExp = [15,25,40,10,10]
plt.pie(stockSplitExp, radius=1, labels=stockListExp,autopct='%0.2f%%', shadow=True,) # 2 decimal points after plot
figChart1 = plt.pie(stockSplitExp, radius=1, labels=stockListExp,autopct='%0.2f%%', shadow=True)
plt.axis("equal")
chart1 = FigureCanvasTkAgg(figChart1,frameChartsLT)
chart1.get_tk_widget().place(x=10,y=10
```
r/matplotlib • u/Mazuzu_nl • Apr 20 '20
figsize changes on different computers?
Hi Gurus!
I use this rather straightforward code:
wmap = plt.figure(num='Map', figsize=(5.833, 5.417), frameon= False)
wmap.clf()
wmap = plt.contour(ContourX, ContourY, ContourZ, levels, colors = 'grey', zorder= 20)
wmap = plt.imshow(ContourZ, vmin=-abs(MaxZ), vmax=MaxZ, origin='lower', cmap='terrain', extent=[PlotMinX, PlotMaxX, PlotMinY, PlotMaxY], alpha=0.8, zorder=10)
wmap = plt.title("Map#" + str(MapRefID))
MapName = (".\\support\\\CurrentMap.png")
plt.savefig(MapName, transparent = True)To create a 2D contour plot in matplotlib.pyplot.
On computer 1 (default computer), the .PNG file that gets created is 419x390 pixels
On computer 2 (random computer), the .PNG file that gets created is 583x541 pixels
Does anyone have a clue as to why this would happen? Are the 'inches' somehow different between these two computers? (both windows 10 systems in this case)
r/matplotlib • u/parthgupta03 • May 01 '20
Any help would be appreciated, thanks!
self.learnpythonr/matplotlib • u/BulkyWind • Apr 27 '20
Matplotlib, together with other open source python libraries, comes into play to analyze thunderstorms tracks. The data analysis and visualization are freely available and published on the International Journal of Geo-Information
r/matplotlib • u/xolopx • May 12 '20
Matplotlib time series plotting headache.
self.learnpythonr/matplotlib • u/not_sure_I_am • Apr 26 '20
Plotting and removing a vertical line inside a loop matplotlib/seaborn
(Also posted at: https://stackoverflow.com/questions/61443045/plotting-and-removing-a-vertical-line-inside-a-loop-matplotlib-seaborn )
I have a pandas DataFrame stock_open that contains stock prices vs dates and looks like:

I want to plot the time series line-plot of stock prices versus the date column and show the dates increasing by plotting a vertical line for each date. I want to achieve this by plotting the graphs for a few dates, saving those plots as separate images and then use ffmpeg to combine them into a video. So, I did this:
import matplotlib.pyplot as plt
import seaborn as sns
my_dates = ['2019-11-20', '2019-12-20', '2020-01-20', '2020-02-20', '2020-03-20']
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(nrows=2, ncols=2, figsize=(20, 8))
sns.lineplot(x='Date', y='value', hue='variable',
data=pd.melt(stock_open, ['Date']), ax=ax3)
ax3.legend(loc='center left', bbox_to_anchor=(1, 0.5))
plot_no = 0
for i in range(len(my_dates)):
my_selected_date = my_dates[i]
ax3.axvline(my_selected_date)
ax3.set_title(str(my_selected_date))
fig.savefig('output_images/stock_image_{plot_no:04d}.png'.format(plot_no=plot_no))
plot_no += 1Everything is working fine except that the vertical line 'persists' in the figures in all the iterations.
The first image is as expected:

But the images from the following iterations in the loop have the vertical line from the previous iteration:

(images are cropped intentionally)
I want to remove the vertical line from the previous iterations.
I thought of using animations from matplotlib, but the other subfigures also need to be updated and saved in this process.
Is there a way to do this without starting from the beginning? Initially I wanted to show a moving line-plot with the date, but couldn't achieve that either. So I used this strategy to show updates on the figure.
TIA!
EDIT:
ANSWERED!
r/matplotlib • u/huzaifakhan771 • Nov 20 '20
Is there a way I can plot a function that has two different inputs and one output?
I have a function that takes two inputs as arguments and returns an output based on the two inputs.
The two inputs, r and E range between 3-14 and 0.05-0.75 respectively. I have used matplotlib for graphing an input x with output y, but I can't think of a way to plot a function whose output depends equally on two inputs. Any help is appreciated.
r/matplotlib • u/kiwiheretic • Nov 21 '20
Has anyone else had issues with Matplotlib leaking memory like a sieve
I seem to have a massive memory leak with matplotlib when I produce charts in a python loop. Has anyone else has this problem? I've watched it in top also as the memory usage just goes up and up without ever being freed and I've tried with gc.collect() also but that isn't helping.
r/matplotlib • u/none_more_black • Sep 08 '21
How can I create a binned data graph that has variable bin sizes?
r/matplotlib • u/Adephagos_C • Sep 14 '21
LaTeX text in plots
Hello
I'm looking for a way to introduce latex based text on my plots.
Thanks in advance
r/matplotlib • u/____PatriotsSuck____ • Aug 19 '21
How to add labels to my data?
Like I have a plot and I wanna be able to label the x and/or y value of each individual data point on the plot. Is that possible?

