Find log(x) using python
Question:
how can I solve this question plot Log(x) where 0<=x<= 3*pi by using python?
t = np.arange(0.01, 20.0, 0.01)
import numpy as np
import matplotlib.pyplot as plt
plt.subplot(222)
plt.semilogx(t, np.sin( 3*np.pi*t))
Answers:
import numpy as np
import matplotlib.pyplot as plt
# use np.linspace to create x-points
t = np.linspace(0.01, 3*np.pi, 50)
plt.plot(t, np.log(t));
how can I solve this question plot Log(x) where 0<=x<= 3*pi by using python?
t = np.arange(0.01, 20.0, 0.01)
import numpy as np
import matplotlib.pyplot as plt
plt.subplot(222)
plt.semilogx(t, np.sin( 3*np.pi*t))
import numpy as np
import matplotlib.pyplot as plt
# use np.linspace to create x-points
t = np.linspace(0.01, 3*np.pi, 50)
plt.plot(t, np.log(t));