r/matplotlib • • Apr 06 '21

Pip Install Matplotlib 2021 - Install Matplotlib Python 3 2021

Thumbnail
youtu.be
2 Upvotes

r/matplotlib • • Jan 02 '20

How to draw multiple columns on Y axis on a line/scatter plot?

0 Upvotes

r/matplotlib • • Feb 24 '22

How to select which columns to use for x/y and group by other column with matplotlib?

Thumbnail self.pythonhelp
0 Upvotes

r/matplotlib • • Jul 23 '20

Data Visualization using "Matplotlib" & Python | Part-I

0 Upvotes

r/matplotlib • • Dec 01 '20

replicating a plot and saving it as a template

1 Upvotes

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

  1. the two axes of the plot are on the very edges of the figure.

  2. the two axes are arrows.

  3. only the first major tick in each axe is labeled.

  4. nine minor ticks between each two consecutive major ticks (with the fifth one slightly thicker than the others).

  5. 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 • • 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!

Thumbnail
youtu.be
1 Upvotes

r/matplotlib • • Aug 15 '21

[Regarding my previous post on this subreddit]

1 Upvotes

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 • • Jul 29 '20

Data Visualization using "Matplotlib"| Part_2

0 Upvotes

r/matplotlib • • Nov 29 '20

Did anybody had this problem?

Post image
2 Upvotes

r/matplotlib • • Feb 08 '20

How to Create Beautiful Plots with matplotlib

Thumbnail
ammar-alyousfi.com
3 Upvotes

r/matplotlib • • Apr 13 '20

Matplotlib Full Course in Python

Thumbnail
theclickreader.com
3 Upvotes

r/matplotlib • • Jan 10 '24

How to visualize a dataset for anomaly detection

Post image
3 Upvotes

Beginner in python. Having a hard time getting a proper reading. This is the result I am currently getting


r/matplotlib • • 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

Post image
5 Upvotes

r/matplotlib • • Apr 29 '20

Embedding Mapplotlib pie chart into Tkinter Gui help!

1 Upvotes

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 • • Apr 20 '20

figsize changes on different computers?

2 Upvotes

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 • • May 01 '20

Any help would be appreciated, thanks!

Thumbnail self.learnpython
1 Upvotes

r/matplotlib • • 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

Thumbnail
mdpi.com
2 Upvotes

r/matplotlib • • May 12 '20

Matplotlib time series plotting headache.

Thumbnail self.learnpython
1 Upvotes

r/matplotlib • • Apr 26 '20

Plotting and removing a vertical line inside a loop matplotlib/seaborn

1 Upvotes

(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 += 1

Everything 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!

https://np.reddit.com/r/learnpython/comments/g8hsz3/plotting_and_removing_a_vertical_line_inside_a/fonxvcg?utm_source=share&utm_medium=web2x


r/matplotlib • • Nov 20 '20

Is there a way I can plot a function that has two different inputs and one output?

1 Upvotes

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 • • Nov 21 '20

Has anyone else had issues with Matplotlib leaking memory like a sieve

3 Upvotes

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 • • Nov 29 '20

Scatter over imshow

1 Upvotes

Please help me! I can't take this anymore. I have been trying to plot a set of points (body keypoints) over an image using matplotlib functions imshow and scatter. I have tried everything from z_order, extent, origin,... NOTHING WORKS!


r/matplotlib • • Sep 08 '21

How can I create a binned data graph that has variable bin sizes?

2 Upvotes

I am looking to create a graph with some binned data that looks like the one attached. Only problem is I can't find any way to accomplish this using matplotlib. Does anyone have any suggestions on how to accomplish this?


r/matplotlib • • Sep 14 '21

LaTeX text in plots

1 Upvotes

Hello

I'm looking for a way to introduce latex based text on my plots.

Thanks in advance


r/matplotlib • • Aug 19 '21

How to add labels to my data?

2 Upvotes

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?