I am making a scatter plot from three separate dataframes and plotting the points as well as the best fit lines. I can accomplish this using this code:
impo
I had the same error. I found out that you shouldn't include the comma after your variable names. So try
scat1 =ax1.scatter(ex_x, ex_y, s=10, c='r', label='Fire Exclusion')
scat2 =ax2.scatter(one_x,one_y, c='b', marker='s',label='One Fire')
scat3 =ax3.scatter(two_x, two_y, s=10, c='g', marker='^', label='Two Fires')
instead of
scat1,=ax1.scatter(ex_x, ex_y, s=10, c='r', label='Fire Exclusion')
scat2,=ax2.scatter(one_x,one_y, c='b', marker='s',label='One Fire')
scat3,=ax3.scatter(two_x, two_y, s=10, c='g', marker='^', label='Two Fires')
This is because axes.scatter returns a PathCollection unlike axes.plot which returns a tuple of the lines plotted (see http://matplotlib.org/1.3.1/users/pyplot_tutorial.html#controlling-line-properties and Python code. Is it comma operator?).
So for your lines you will still need the comma because you are unpacking the tuple but for the scatter you should not have the comma.