Category "matplotlib"

Scatter plot form dataframe with index on x-axis

I've got pandas DataFrame, df, with index named date and the columns columnA, columnB and columnC I am trying to scatter plot index on a x-axis and columnA on

plotting data from a list in python

I need to plot the velocities of some objects(cars). Each velocity are being calculated through a routine and written in a file, roughly through this ( I have

How to avoid overlapping when there's hundreds of nodes in networkx?

I've got 2000+ nodes and 900+ edges, but when I was trying to make graphics in networkx, I found all the nodes crowded together. I tried changing attribute valu

How to detect if a twin axis has been generated for a matplotlib axis

How can one detect if an axis has a twin axis written on top of it? For example, if given ax below, how can I discover that ax2 exists? import matplotlib.pyplo

Is it possible to both save and show matplotlib animation without running each frame twice?

It is possible to save, and then show, a matplotlib animation, but it takes twice as long as it could, in all examples that I have found. I wonder if the same t

Matplotlib and Pandas Plotting amount of numbers in certain range

I have pandas Dataframe that looks like this: I am asking to create this kind of plot for every year [1...10] with the Score range of [1...10]. This means that

Why can I not run matplotlib on Python 3.10?

My Issue. I am trying to run matplotlib on python 3.10 on my MacOS, but I get the following error: ModuleNotFoundError: No module named 'matplotlib' However, w

Matplotlib in Rmarkdown/RStudio fails when calling LaTeX on `\$` with Anaconda

Problem description I am having to use Anaconda on Windows, and am trying to write an RMarkdown document, knitted into a pdf, where within the RMarkdown I am us

imshow subplot placement inside matplotlib figure

I have a Python script that draws a matrix of images, each image is read from disk and is 100x100 pixels. Current result is: matrix of images I don't know why P

How to plot a NetCDF time dependend data set with correct axis format?

I made a pcolormesh-plot from data in NetCDF data format. I don't manage the x- and y-axis to show the right axis ticks from the data set. Instead both axis sta

How to plot a histogram using Matplotlib in Python with a list of data?

How do I plot a histogram using matplotlib.pyplot.hist? I have a list of y-values that correspond to bar height, and a list of x-value strings. Related: matplot

Matplotlib date formatter with Latex uses math mode

Overview So I made a switch from an older version of Python + Matplotlib to a newer one and have notices the following change in behaviour which seems to be bre

How to deal with the colorbar axis space in matplotlib subplots

I am plotting seven different parameters over four seasons, as shown in below image. but on last column (Post-Monsoon) sub_plots axis compromised with colorbar

Obtaining the exact data coordinates of seaborn boxplot boxes

I have a seaborn boxplot (sns.boxplot) on which I would like to add some points. For example, say I have this pandas DataFrame: [In] import pandas as pd

Correct placement of colorbar relative to geo axes (cartopy)

Using Cartopy, I would like to have full control of where my colorbar goes. Usually I do this by getting the current axes position as basis and then create new

Remove legend key in matplotlib

I want to show a legend text but without a key (the rectangular box or line that appears by default). plt.hist(x, label = 'something') I don't want the bo

Python hide ticks but show tick labels

I can remove the ticks with ax.set_xticks([]) ax.set_yticks([]) but this removes the labels as well. Any way I can plot the tick labels but not the ticks a

save multiple objects to zip directly from memory

I'd like to save multiple objects, e.g. figures, created in a loop directly to a zip file, without saving them in directory. At the moment I'm saving the figure

3D 3-body motion simulation

I am trying to use the velocity Verlet to simulate the 3-body problem. I am 95% sure that I gravitational force formula and the velocity Verlet algorithm is cor

How to mantain aspect ratios after overlay in geopandas?

I'm trying to overlay some cities on top of a map. import pandas as pd import geopandas as gdp import matplotlib.pyplot as plt from shapely.geometry import box