All Questions
3,328 questions
1
vote
1
answer
102
views
How to plot 4*sin(2*x)/cos(2*x)**3 using Sympy?
I am trying to plot the expression 4*sin(2*x)/cos3(2*x) in Sympy:
from sympy import *
from sympy.plotting import plot
x = symbols('x')
expr = 4*sin(2*x)/cos(2*x)**3
plot(expr)
But all I get is:
when ...
1
vote
2
answers
1k
views
Matplotlib: Making axes fit shape limits
I'm trying to draw a rectangle in matplotlib using the following code:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig, ax = plt.subplots()
width = 20
height = 10
rect = ...
0
votes
1
answer
96
views
Aligning matplotlib subplots one with stacked bar plot and another with line plot using matplotlib in Python [duplicate]
I have 2 dataframes as follows:
df1.to_dict() results in
{'Peak Demand PES': {2023: 124126.91,
2025: 154803.41,
2030: 231494.66,
2040: 483217.66000000003,
2050: 1004207.86},
'Peak Demand TES':...
0
votes
0
answers
37
views
open ICON model with python
I'm trying to open the precipitation data from the ICON model, but I'm running into some difficulties. Could someone help me?
The data is located here: https://opendata.dwd.de/weather/nwp/icon/grib/00/...
48
votes
2
answers
112k
views
Hide axis label only, not entire axis, in Pandas plot
I can clear the text of the xlabel in a Pandas plot with:
plt.xlabel("")
Instead, is it possible to hide the label?
May be something like .xaxis.label.set_visible(False).
0
votes
2
answers
10k
views
Unable to import matplotlib pyplot
I am unable to import pyplot. How can the error be resolved?
>>> from matplotlib import pyplot
Jul 16 12:49:46 Python[35767] <Error>: Set a breakpoint at CGSLogError to catch errors as ...
-2
votes
0
answers
61
views
Error ModuleNotFoundError: No module named 'matplotlib'
I am a complete beginner to Python programming. I am working on Windows 11 on my home PC.
I have installed Python version 3.13 & matplotlib version 3.10.0.
I get:
module not found
error when I ...
1
vote
1
answer
65
views
Some minor tick labels do not show on log axis
I'm trying to customize major and minor tick labels on a log y axis where all labels are in %g format.
When the minor 2s and 5s are labeled, and both major and minor grid lines are showing and the ...
38
votes
4
answers
190k
views
How to add a variable to Python plt.title? [duplicate]
I am trying to plot lots of diagrams, and for each diagram, I want to use a variable to label them. How can I add a variable to plt.title? For example:
import numpy as np
import matplotlib.pyplot as ...
1
vote
2
answers
4k
views
How to set height of Barplot?
I try to set the height of a result of one barplot.
Can someone help me ?
Actually, I have this result ?
Thank you
0
votes
1
answer
54
views
Matplotlib Plotting repeating steps in x axis
I have a dataframe like the following:
ID Parm_1 Parm_2 Result
0 100 100 0.2
1 100 200 0.4
3 100 300 0.9
4 100 400 0.45
5 ...
2
votes
1
answer
70
views
Matplotlib show function is showing the plot window minmized after python input command
Im seeing strange behavior to the matplotlib plot.show() function as result of the python input command as in the below code. If I take the input command the plot window will show up and centered to ...
2
votes
2
answers
4k
views
have some indication for overlapping bars in seaborn histplot
In histograms plotted with seaborn, when the bars overlap becuase of using hue, the colors change, often indistinguishable. That makes it hard to explain the plots to people. this gets increasingly ...
12
votes
1
answer
3k
views
Copy matplotlib artist
I created an array of Line2D-objects with matplotlib that I'd like to use in various plots. However, using the same artist in multiple plots doesn't work since I get:
RuntimeError: Can not put single ...
2
votes
1
answer
628
views
Matplotlib not found on Jupyter notebook
I'm new to command line programming so please bear with me. I've been trying to run matplotlib inline in my Jupyter notebook using the following command:
%matplotlib inline
and I get the following ...