Matplotlib log (log (x)) SkalaPython

Python-Programme
Anonymous
 Matplotlib log (log (x)) Skala

Post by Anonymous »

Ich brauche ein Diagramm, das nicht zur üblichen 'log-log' Definition passt, aber eine lineare X-Skala und eine doppelte logarithmische y-Skala hat. Ich habe versucht, dies in Matplotlib mit < /p>
zu erstellenimport numpy as np
from matplotlib import pyplot as plt

# constants that result from other part of program
b = 9.144
c = -3.579

# values for plot
XL = np.linspace(273.15,373.15,101)
YL = 10 ** 10 ** (b + c * np.log10(XL)) - 0.7

# functions for scale transformation
def fw(x):
return np.log10(np.log10(x))

def bw(x):
return 10 ** 10 ** x

plt.plot(XL - 273.15, YL)
plt.yscale('function', functions=(fw, bw))
plt.show()
< /code>
finden Sie dieses Bild als Referenz. Dieses Programm hat jedoch zwei Probleme: < /p>

Die y -Achsen -Zecken beginnen bei 100, aus einem Grund, den ich nicht verstehe, und den größten Teil der Grafik ohne Zecken zurücklasse.RuntimeWarning: divide by zero encountered in log10
return np.log10(np.log10(x))
RuntimeWarning: invalid value encountered in log10
return np.log10(np.log10(x))
< /code>
Ich verstehe, dass die erste Warnung wahrscheinlich zum zweiten führt, aber ich verstehe nicht, warum es eine Division von Null geben würde. Jede Unterstützung bei der Erleuchtung beider Probleme wäre sehr geschätzt.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post