All Questions
1,141 questions
0
votes
1
answer
57
views
How to resize graph and make it fit x in the range of 15 to 30? [closed]
import numpy as np
import matplotlib.pyplot as plt
import scipy
x5=[34.5,35.5,34.5,34.5,36.5,37.2, 37.5,36.5,36,37.5]
y5=[11,12.6,11,10,11,12,12.6,11,10,10.5]
t5=np.linspace(0, len(x5), num=len(x5), ...
0
votes
0
answers
54
views
Phase Portrait of Coupled ODEs Not Matching Expected Graph in Python (SciPy)
I’m trying to generate a phase portrait for a system of coupled ordinary differential equations (ODEs) using Python’s scipy.integrate.solve_ivp. The system models the frequency of cooperators (x) and ...
0
votes
3
answers
89
views
Logistic curve produced by curve_fit is a straight line
I'm trying to produce a Sigmoid/Logistic curve from some input data. I borrowed code from this post and this for plotting.
The result is the following:
from scipy.optimize import curve_fit
import ...
0
votes
3
answers
134
views
Matplotlib KDE on Ternary Plot – Unexpected Density Scaling
I am working on a ternary KDE (kernel density estimate) plot using Matplotlib + SciPy’s gaussian_kde, but the density scaling is not behaving as expected.
The top panel (scatter plots) shows ternary ...
3
votes
1
answer
83
views
Inverse Fast Fourier Transform (ifft2) of scipy not working for fourier optics
I'm following a tutorial on youtube on Fourier Optics in python, to simulate diffraction of light through a slit.
The video in question
Source Code of video
Now, I'm trying to implement the get_U(z,...
2
votes
0
answers
210
views
How to convert contourf values and plot to surface of 3d sphere
I am trying to use matplotlib contourf to generate a contour plot of temperature data. I would then like to map this data onto a 3d sphere. I am using vpython to render the image. The issue I have is ...
0
votes
0
answers
59
views
SciPy Stats Library .fit() Command Issues Generating Fit With Imported File
I have an Excel file I have imported into a Pandas DataFrame. The file has four variables and we are supposed to run normality tests (Shapiro-Wilk, D'Agostino's, Anderson-Darling) for the data and ...
0
votes
1
answer
75
views
Gamma function fitting OptimizeWarning: Covariance of the parameters could not be estimated in Python
I am trying to fit functions to histograms using curve_fit from scipy, however a warning occurs when running the program:
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import ...
0
votes
1
answer
71
views
how do fit probolic on data with python [duplicate]
sorry for asking low level questions. I'm a physicist and I don't know much about programming
I have data want to do fit probolic on it and I have no solution to solve it
example file data
x
y
z
t
-2....
0
votes
2
answers
176
views
Interpolating 3D heat map in matplotlib (XY,C)
I have plotted X,Y co-ordinates in a 2D polar-plot, and I am passing a third value to each co-ordinate that is my third dimension. I am trying to the interpolate between all plotted points, similar to ...
0
votes
1
answer
79
views
How to properly shear a line in a 2D image using interpolation in Python?
I'm trying to apply a shearing transformation to a simple 2D line filter (represented as a binary image) using interpolation methods in Python. However, the resulting image after applying the shear ...
-1
votes
1
answer
83
views
How to correctly extract white pixels from binary images and display them correctly on the plotlib?
This is a binary image, I want to calculate the distance between two edges of the pixel, then display it on a drawing board. I handle it when it does not have branches, but when it has branches like ...
1
vote
2
answers
113
views
Python curve fitting gone wrong
I am trying to fit some data to a theoretical Laser interferometric vibrating speaker system characterization model, and I am running into some problems. Here's the mathematical model:
Here's the ...
0
votes
0
answers
95
views
CDF matching approach
Good evening,
I need to apply the CDF matching approach to normalized (transforms a time series' mean, variance, skewness, and kurtosis to approximately harmonize the reference time series) the ...
0
votes
2
answers
439
views
Plotting a chirp square signal in python
Wikipedia definition: A chirp is a signal in which the frequency increases (up-chirp) or decreases (down-chirp) with time. In some sources, the term chirp is used interchangeably with sweep signal.
I ...