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 ...
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/...
-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 ...
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
1
answer
39
views
Create background for a 3D and 2D plots
Can someone help me create a layout for plots with the following structure:
A CD
A/B EF
B GH
where A,B are 3D plots (fig.add_subplot(241, projection='3d')) and C,D,E,F,G,H are regular 2D plots. A/...
1
vote
1
answer
44
views
Issues with Axes (matplotlib) inheritance
I'm trying to mimic the plt.subplots() behavior, but with custom classes. Rather than return Axes from subplots(), I would like to return CustomAxes. I've looked at the source code and don't ...
0
votes
0
answers
30
views
Matplotlib: unite entries in the legend with a bracket [duplicate]
So, I haven't found anything that could solve my problem.
The issue is the following, I have a number of entries like: A, B, C, which belong to a group "Letters", I also have a symbol I, ...
0
votes
0
answers
38
views
Matplotlib : How does it work and why does i only shows the positive x-axis [duplicate]
I have a code where I want the user to be able to give a function, which will then be graphed with matplotlib. So I look up online how matplotlib works, and I end up with this code :
framegraph = ...
3
votes
1
answer
127
views
Trying to time the "in" operator
I have a question about how the in operator works internally. So to test it I tried to graph the time it takes to find a member of a list, in different parts of the list.
import time
import matplotlib....
0
votes
0
answers
43
views
Return something from onclick?
I have a function that creates a chart with pandas & matplotlib. In the function there is an onclick handler that creates a table and then shows it with plt.show() upon click.
When the entire ...
1
vote
2
answers
45
views
bar chart not resize
I got a problem trying to plot the larger version of this data (it has weeks till today) having all data in that plot space makes not legible the bars labels (3rd image as reference), I don't know ...
2
votes
2
answers
72
views
Perfect crossing of two dashed lines
I want to plot two dashed lines crossed at (0,0).
But, I would like it to look perfect (more like
cross in the middle), not shifted in (0,0) as in
the code below.
plt.figure(1, figsize=(10,10))
x = ...
0
votes
0
answers
26
views
Hide bbox annotations when mouse hover out of the graph
I am currently using matplotlib to plot the line graph and mplcursors to annotate the line graph. My current problem right now is how to hide the bbox annotation everytime the mouse is hover outside ...