Questions tagged [matplotlib]
Matplotlib is a plotting library for Python which may be used interactively or embedded in stand-alone GUIs. Its compact "pyplot" interface is similar to the plotting functions of MATLAB®.
matplotlib
72,484
questions
1
vote
1
answer
21
views
Adding a flag to the end of a bar chart in python
I was trying to follow an example outlined here https://stackoverflow.com/a/61973946
The code, after small adjustments looks like this:
def pos_image(x, y, pays, haut):
pays = countries.get(pays)....
0
votes
0
answers
21
views
Create gradient-fill plot in Python (using seaborn / plotly / bokeh / matplotlib?) [closed]
I need to create an plot like this in Python. I don't really care what library to use (seaborn / plotly / bokeh / matplotlib?), but the goal is to replicate the green-yellow-red gradient fill. The ...
0
votes
0
answers
16
views
How to fix my Python Flet Audio Visualizer that is not working without an error in the terminal
Title: Audio Plays but Spectrum Visualization Not Showing in Flet Audio Visualizer.
I am working on an Audio Visualizer using the Flet framework. The sound plays correctly, but the spectrum ...
0
votes
1
answer
27
views
Plotting a function that is a string in matplotlib // interpreting a str as python code?
I am creating an RPN calculator that tries to plot the function given by a user. For example, if a user inputs "x sin 3 * plot" I would expect it to plot sin(x)*3. The code for this is below....
0
votes
0
answers
14
views
Matplotlib Plot Not Responding in VSCode Debug Mode
I'm encountering an issue when trying to plot a simple graph using Matplotlib in Python while in debug mode in VSCode. The plot works perfectly in normal execution mode, but when I set a breakpoint ...
0
votes
3
answers
52
views
How to remove large space between rows in matplotlib plot?
Code:
fig, axes = plt.subplots(2, 6)
for row in axes:
for ax in row:
## Set limits
ax.set_xlim(-1, 1)
ax.set_ylim(-1, 1)
## Set aspect ratio
ax.axis('...
0
votes
1
answer
27
views
Remove blank area of matplotlib between distance of zero for multivariate time series
I have two time series:
First row is prediction
second row is ground truth
I want remove this red area, where it should be flexible.
I mean there is no distance between them like this picture, ...
0
votes
0
answers
47
views
How to apply stippling to contourf plots in Python?
I want to add stippling to Xarray DataArray data to indicate significance. The data is 2D climate data on a lat lon grid. I want to give a True/False mask to plot over mapped variable data. I am ...
0
votes
1
answer
21
views
How to control color bar secondary y axis ticks
I've got a colorbar displaying the log of probability for some data. I want a 2nd set of ticks for the colorbar that displays "raw" probability values. I have this working somewhat, but I ...
0
votes
1
answer
23
views
Matplotlib.scatter documentation covers some parameters unclearly
I was searching for how to plot a scatter plot with points that have a transparent face but coloured edges. This page gave some ideas, but I find the behaviour of some arguments to differ than ...
0
votes
0
answers
23
views
Plotting a bar graph using seaborn with hue, how to get bar labels as percentage values [duplicate]
I have the following data set(df):
source_city class price
0 Bangalore Business 53671.856898
1 Bangalore Economy 6526.294410
2 Chennai Business 54036.749819
3 ...
0
votes
0
answers
19
views
How to set thresholds on colorbar in matplotlib imshow plot?
I am trying to duplicate the following color bar with matplotlib. It is shown to the right of an image. Originally this color bar was produced in Matlab. However I think that I can define another axis ...
0
votes
1
answer
25
views
How to project a contour map on the xy plane using matplotlib?
How can I plot a contour map on the xy plane rather than on the 3d surface of the function?
I wanted to plot the contour where z = 0.
However, my currently output is producing this:
The following ...
0
votes
1
answer
28
views
PyPlot plots are bigger with high DPI, but still blurry
I am following a tutorial to generate a scatter plot of points, coloured by cluster and also colour-saturated based each point's strength of membership in its respective clusters. I mention the ...
0
votes
1
answer
18
views
Matplotlib move secondary x axis to specific position
The following MWE
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
# Use latex
import os
os.environ["PATH"] += os.pathsep + '/usr/local/texlive/2024/bin/x86_64-...