6.5. Matplotlib Scales

6.5.1. Rationale

  • Liniowa

  • Logarytmiczna

  • Symmetrical log (można ustawić fragmentami liniowo linthreshx: int)

  • Logit - odwrotność logistycznej

  • Subtracting x.mean() is used to better highlight the function

6.5.2. Linear Scale

import matplotlib.pyplot as plt
import numpy as np


x = np.linspace(0, 10, 1000)
y = x - x.mean()

plt.yscale('linear')

plt.plot(x, y)
plt.show()

6.5.3. Logarithmic Scale

import matplotlib.pyplot as plt
import numpy as np


x = np.linspace(0, 10, 1000)
y = x - x.mean()

plt.yscale('log')

plt.plot(x, y)
plt.show()

6.5.4. Symmetrical Logarithmic Scale

import matplotlib.pyplot as plt
import numpy as np


x = np.linspace(0, 10, 1000)
y = x - x.mean()

plt.yscale('symlog', linthresh=0.01)

plt.plot(x, y)
plt.show()

6.5.5. Logit Scale

import matplotlib.pyplot as plt
import numpy as np


x = np.linspace(0, 10, 1000)
y = x - x.mean()

plt.yscale('logit')

plt.plot(x, y)
plt.show()