import numpy as np x = np.arange(0, np.pi * 2, 0.5) # Array from 0 to 2π y = np.sin(x) # sin(x) import c3pyo as c3 chart = c3.SplineChart() chart.plot(x, y, label='f(x) = sin(x)') chart.xlabel('x') chart.ylabel('f(x)') chart.show()
import numpy as np x = np.arange(0, 3, 0.5) # Array from 0 to 3 y1 = x / (1 + np.abs(x)) y2 = np.tanh(x) y3 = x / ((1 + x **2) ** 0.5) import c3pyo as c3 chart = c3.SplineChart() chart.plot(x, y1, color='indigo', label='f(x) = x / (1 + |x|)') chart.plot(x, y2, color='red', label='f(x) = tanh(x)') chart.plot(x, y3, color='orange', label='f(x) = x / sqrt(1 + x^2)') chart.xlabel('x') chart.ylabel('f(x)') chart.show()