I am drawing a scatter plot using the following code
fig, ax = plt.subplots(figsize=(20, 15))
ax.scatter(found_devices_df['time'], found_devices_df['label'], c=found_devices_df['label'],
marker='.', s=found_devices_df['count']*100, alpha=.6)
fig.autofmt_xdate()
I want to draw horizontal lines and vertical lines (not equally spaced grids) per each level of x and y axes respectively. I have timestamps
in the X-axis and the device type on the Y-axis.
How can I use ax.hline
and ax.vline
for this?
I tried ax.axvline(found_devices_df['time'], color="red", linestyle="--")
to draw vertical line per each x datatime stamp but got an error
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()