I just started with python yesterday, since it seemed to be a good and easy solution for our task. We are making a logger which will monitor long-time-tests of batterychargers and other equipment in that field.
Right now I'm using mock numbers made from a number generator, we will soon have some actual and more even numbers to work with, but the actual grap worries me, since it's so compressed. Is there any way to "widen" the x-axis, to up the resolution and thereby stretch the graph?
import numpy as np
import matplotlib.pyplot as plt
data = np.loadtxt('test.txt')
x = data[:, 0]
y = data[:, 1]
y2 = data[:, 2]
y3 = data[:, 3]
fig = plt.figure(facecolor = ("Pink"))
ax = fig.add_subplot(111)
ax.plot(x, y, '--', label='Voltage')
ax.plot(x, y2, '-.', label='Current')
ax2 = ax.twinx()
ax2.plot(x, y3,'g:', label='Temperature')
fig.legend(edgecolor = ("DarkBlue"), facecolor = ("LightBlue"), loc="upper right", bbox_to_anchor=(1,1), bbox_transform=ax.transAxes)
ax.set_title("Test Surveillance", color = ("Purple"))
ax.set_xlabel('Milliseconds', color = ("LightGreen"))
ax.set_ylabel('Volts and Amps', color = ("DarkGrey"))
ax2.set_ylabel('Celsius', color = ("LightBlue"))
plt.show()
Ignore the color scheme, it's for testing and annoying my friend.