Recherche…


Introduction

LogLog graphing est une possibilité d'illustrer une fonction exponentielle de manière linéaire.

LogLog graphique

Soit y (x) = A * x ^ a, par exemple A = 30 et a = 3.5. En prenant le logarithme naturel (ln) des deux côtés, on obtient (en utilisant les règles communes pour les logarithmes): ln (y) = ln (A * x ^ a) = ln (A) + ln (x ^ a) = ln (A) + a * ln (x). Ainsi, un tracé avec des axes logarithmiques pour x et y sera une courbe linéaire. La pente de cette courbe est l'exposant a de y (x), tandis que l'ordonnée à l'origine y (0) est le logarithme naturel de A, ln (A) = ln (30) = 3,401.

L'exemple suivant illustre la relation entre une fonction exponentielle et le tracé de loglog linéaire (la fonction est y = A * x ^ a avec A = 30 et a = 3.5):

import numpy as np
import matplotlib.pyplot as plt
A = 30
a = 3.5
x = np.linspace(0.01, 5, 10000)
y = A * x**a

ax = plt.gca()
plt.plot(x, y, linewidth=2.5, color='navy', label=r'$f(x) = 30 \cdot x^{3.5}$')
plt.legend(loc='upper left')
plt.xlabel(r'x')
plt.ylabel(r'y')
ax.grid(True)
plt.title(r'Normal plot')
plt.show()
plt.clf()

xlog = np.log(x)
ylog = np.log(y)
ax = plt.gca()
plt.plot(xlog, ylog, linewidth=2.5, color='navy', label=r'$f(x) = 3.5\cdot x + \ln(30)$')
plt.legend(loc='best')
plt.xlabel(r'log(x)')
plt.ylabel(r'log(y)')
ax.grid(True)
plt.title(r'Log-Log plot')
plt.show()
plt.clf()

Parcelle normale Tracé LogLog



Modified text is an extract of the original Stack Overflow Documentation
Sous licence CC BY-SA 3.0
Non affilié à Stack Overflow