1
0
Fork 0
Browse Source

adjust y-axis range and reposition legend.

I reduced the range on the y-axis to make the change in the light
levels more noticable (at a glance/distance). The range is now closer
to the upper and lower limits of the system so there is less 'excess'
space in the chart.

With the scaling down of the range on the y-axis, the legend was
starting to get in the way of the lastest readings -- when there is a
high light-reading. To combat this, I moved the legend to the
lower-left part of the graph. If the light reading goes into the
negatives (lights off in the factory but the system is still on), the
legend can still impede but it only does so on the oldest of the
readings on the graph. Also, the legend is slightly transparent so you
can still see behind it, it's just cumbersome (especially at a
glance/distance).
master
Craig Oates 3 years ago
parent
commit
95f5d5f426
  1. 5
      light-wave.py

5
light-wave.py

@ -9,7 +9,7 @@ session = requests.Session()
# Parameters
x_length = 600 # No. of readings show at one time.
y_range = [-100, 100] # Light reading range.
y_range = [-80, 65] # Light reading range.
# Figure/Graph Details
fig = plt.figure()
@ -22,8 +22,7 @@ line2, = ax.plot(ys2, label='factory2')
plt.title("Light Meter Readings in Ritherdon")
plt.xlabel("<--- Oldest (Time) Latest --->")
plt.ylabel("Light")
plt.legend()
plt.subplots_adjust(bottom=0.20)
plt.legend(loc='lower left')
ax.set_xticklabels(())