About 66,900 results
Open links in new tab
  1. Plotting exponential function python - Stack Overflow

    Jun 29, 2016 · I get a linear graph when trying to plot exponential function: import math import numpy as np import matplotlib.pyplot as plt def graph(formula, x_range): x = np.array(x_range) y = eval(formula) plt.plot(x, y) graph('100*(np.power(0.8, x))', (0,100))

  2. How to do exponential and logarithmic curve fitting in Python?

    Nov 4, 2022 · Exponential curve fitting: The exponential curve is the plot of the exponential function. Let us consider two equations . y = alog(x) + b where a ,b are coefficients of that logarithmic equation. y = e (ax)*e(b) where a ,b are coefficients of that exponential equation.

  3. Exponential plotting in Python - Stack Overflow

    I am trying to plot these data points in an exponential way in order to get an image that justifies the limit as x -> infinity. I have read other users' posts and the main suggestion is to use curve_fit from scipy.

  4. Python math.exp() Method - W3Schools

    The math.exp() method returns E raised to the power of x (E x). 'E' is the base of the natural system of logarithms (approximately 2.718282) and x is the number passed to it. Required. Specifies the exponent. Math Methods. Track your progress - it's free!

  5. Python Program to Plot Exponential Function - Codesansar

    This Python program plots growing and decaying exponential curve using numpy and matplotlib library. import matplotlib. pyplot as plt. # Generating time data using arange function from numpy .

  6. Exponential Graph using Python - biob.in

    Feb 21, 2014 · Introduction to Exponential Graph. Exponential curve a is smooth and continues line of graph, connected by a series of co-ordinates calculated using a polynomial equation containing variable exponential value (For example, y = f(x), where f(x) = Ae Bx + C).

  7. Plot Mathematical Expressions in Python using Matplotlib

    Apr 17, 2025 · Matplotlib is a python library used for plotting and visualising, it also allows us to visualize mathematical expressions and functions easily. In this article, we will learn how to plot mathematical expressions in it.

  8. Curve Fitting in Python: Exponential Functions - GitHub Pages

    import matplotlib.pyplot as plt ax = plt.axes() ax.scatter(x, y, label='Raw data') ax.plot(x_fitted, y_fitted, 'k', label='Fitted curve') ax.set_title('Using polyfit() to fit an exponential function') ax.set_ylabel('y-Values') ax.set_ylim(0, 500) ax.set_xlabel('x-Values') ax.legend()

  9. python - Plotting exponential function - Stack Overflow

    Oct 1, 2019 · While the answer below solves your problem, I would also recommend using NumPy. First import numpy as np and then directly define the input mesh and perform exponential operation without using for loops: x = np.arange(101); y = np.exp(x) You can change your code in this way: m = math.exp(i) print("For i = ",i) print("(e^i) = ",m) m_l.append(m)

  10. NumPy Exponential Function in Python - CodeSpeedy

    So as we know about the exponents, this Exponential Function in Numpy is used to find the exponents of ‘e’. We know that the value of ‘e’ is ‘2.71828183’. If we need to find the exponential of a given array or list, the code is mentioned below. import numpy as np #create a list l1=[1,2,3,4,5] print(np.exp(l1)) Run this code online

Refresh