I'm trying to make three scatter plots in one figure. I tried it this way.
Do an import first.
import matplotlib.pyplot as plt
Define the variables and make one figure that contains three scatter plots.
c_pop = [0.410, -0.094, -0.111, -0.106, -0.090, 0.070, -0.043, -0.181, 0.221]
c_labels = ['ll120', 'll123', 'll124', 'll27', 'll28', 'll30', 'll446, n12', 'll447, n86', 'll471']
pre_lo = [-0.493]
post_lo = [0.145]
lo_label = ['lo']
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.scatter(c_labels, c_pop, color='black')
ax1.scatter(lo_label, pre_lo, color='green', label='pre-SNEP')
ax1.scatter(lo_label, post_lo, color='red', label='post-SNEP')
plt.show()
The error I get is: could not convert string to float: lo
It seems like it tries to convert lo_label into something else.
The code runs if I disable the first scatter plot and only run the second and the third. It also runs when I only run the first scatter plot and disable the second the third.
What is going wrong? Is it possible to make three scatter plots in one plot with labels on the x-axis?