Skip to content

Instantly share code, notes, and snippets.

@uysalserkan
Created April 7, 2020 17:06
Show Gist options
  • Save uysalserkan/afa1c1cec1437ec2df5e9c127cbc8c22 to your computer and use it in GitHub Desktop.
Save uysalserkan/afa1c1cec1437ec2df5e9c127cbc8c22 to your computer and use it in GitHub Desktop.
Electronic Report 2 - Part A - 1 Plot
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
cur_vol = {"Voltage": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "Current": [0.0000555556, 0.000111111,
0.000166667, 0.000222222, 0.000277778, 0.000333333, 0.000388889, 0.000444444, 0.0005, 0.000555556]}
data = pd.DataFrame(cur_vol)
plt.plot(data.Voltage, data.Current, color="red")
plt.scatter(data.Voltage, data.Current, color="red")
plt.bar(data.Voltage, data.Current, alpha=0.5, align="center", color="blue")
plt.xticks(ticks=data.Voltage)
plt.yticks(ticks=data.Current)
plt.title("Current - Voltage Graph")
plt.xlabel("Voltage")
plt.ylabel("Current")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment