Category "matplotlib"

Matplotlib SubPlotpositions in Figure and general heading "figure"

For plotting data I have created the Figure. figure Is there a possibility to reduce the horizontal and vertical distances between the subplots and the vertival

Plotting border of masked array with plt.imshow

Actually plotting this image using plt.imshow and np.masked to plot the figure in blue. I would like to remove the inner part of the figure and just leaving the

Matplotlib not plotting at all correctly, not seen anyone else have this issue

So, I'm trying to code with matplotlib, so that it plots coordinates of the majority of cities in the USA on a graph. As should be evident by the fact I'm askin

Set 'global' colorbar range for multiple matplotlib subplots of different ranges

I would like to plot data in subplots using matplotlib.pyplot in python. Each subplot will contain data of different ranges. I would like to plot them using pyp

matplotlib 3D scatter plot alpha varies when viewing different angles

When creating 3D scatter plots with matplotlib I noticed that when the alpha (transparency) of the points is varied it will draw them differently depending on h

How animation scatter plot with Matplotlib can be done with not superimposed data?

I want to do an animated scatter plot with one only pair of x,y data for each frame. The code I wrote creates an animated scatter plot but the old dots appear i

Quantify longest axis and width of irregular shapes within a single image

Original question I have about 80-100 images such as (A). Each image is composed of shapes that were filled with black color after marking the outline in ImageJ

can't convert cuda:0 device type tensor to numpy

As metioned in the title, I am getting this TyperError for the following code I am using google collab and is set to GPU runtime type. %%time history = [evaluat

Matplotlib How to change length of line

Can you please help, how to change my code, so the red line will be longer and connect black point? data.plot(kind = "scatter", x = "Pocet.potvrdenych", y = "Po

Recenter plot after set_xdata and set_ydata

I can use the set_xdata and set_ydata functions to update an existing matplotlib plot. But after updating I want to recenter the plot so that all the points fal

How do I solve this too crowded x-axis when x-ticks does not work?

Context: The Data is on the millisecond and is in the following format: '08:04:18.795' '08:13:15.496' Now what I want is to create specific time brackets (e.g.

Showing different size circles in heatmap with legend using Matplotlib

I am asking a question stemming from this original post Heatmap with circles indicating size of population I am trying to replicate this using my dataframe, how

LaTeX Error: File `type1cm.sty' not found

I need to export a figure from matplotlib without type 3 fonts on MacOS. I found that I have to set the following rc parameters: matplotlib.rcParams['pdf.fo

Tkinter closing immediatly after plot

I am creating an interface using Tkinter to plot signals from a database. I am using Python 3.8 and PyCharm 2021.2.1. The interface is supposed to open another

Plot histogram from two columns of csv using pandas

I have a csv file containing two columns. What I'd like to do is to plot a histogram based on these two columns. My code is as follows: data = pd.read_csv('data

Matplotlib colorbar labels to fit into boxes

I created a scatter plot using matplotlib but I am somehow unable to get the labels to center into the boxes within the colorbar.. This is the code I have so fa

How to subtract 1 dimension Numpy arrays with different shapes and plot the difference in seaborn or matplotlib? [duplicate]

Basically I have these arrays print(img_arr[0].shape)->(returns) (122218,) print(img_arr1[0].shape)->(returns) (125204,) so when I did

How to plot a streamplot in python for a streamline flow arround a cylinder?

I have written a program where it takes a radius range(R to 5) and theta range(0 to 2pi). It converts the polar coordinates to Cartesian coordinates. Then I hav

Cartopy issue with extent (free(): invalid size)

I'm using Cartopy and I struggle with this issue free(): invalid size. It occurs when I set the map extent. extents = [-13, 44, 34, 63] # Europe proj = cartopy.

Contour plots for multivariate gaussian

I'm trying to use a contour plot to visualize a multivariate normal distribution. import numpy as np from scipy.stats import multivariate_normal mean = (0, 0)