import matplotlib.pyplot as plt
import numpy as np
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set(xlabel='time (s)', ylabel='voltage (mV)',
title='Test Plot Python Menggunakan Matplotlib')
ax.grid()
fig.savefig("test.png")
plt.show()
Plot Grafik Dasar Python Menggunakan Modul Matplotlib
June 06, 2022
0
Berikut adalah kodingan dasar untuk mem-plot pada Python menggunakan Matplotlib dan hasilnya akan seperti gambar berikut :
Tags