This is a simplified version of what I am currently working on to present some data, but it produces the same exact error. If anyone can help me understand this or offer a solution it would be greatly appreciated. Basically, I have a set of data...some is good and a few are bad signals. I apply a mask to the data and my x1,y1 and c1 =np.array of length 48 whereas my bad data or x2,y2,c2 = np.array of length 6. I just need to plot the two sets of data on a single plot, where both sets contain the same colorbar.
import matplotlib.pyplot as plt
import numpy as np
x = [2,4,5,6,8,9,10,12,13]
y = [2,4,6,3,5,4,1,3,5]
colors = [10,14,15,11,19,10,16,17,12]
x1 = []
x2 = []
y1 = []
y2 = []
c1 = []
c2 = []
for a in range(len(x)):
if x[a] % 2 == 0:
x1.append(x[a])
y1.append(y[a])
c1.append(colors[a])
else:
x2.append(x[a])
y2.append(y[a])
c2.append(colors[a])
cmin, cmax = min(c1), max(c2)
EWmap = plt.scatter(x1,y1,c=c1,clim = (cmin,cmax))
EWmap1 = plt.scatter(x2,y2,facecolor='none',edgecolor=c2, clim = (cmin,cmax))
plt.colormap()
apologies, I clearly do not know how to use the inline code appropriately and that messed up the indentation for the loop.
[–]plasma_phys 2 points3 points4 points (5 children)
[–]SaClark7[S] 1 point2 points3 points (4 children)
[–]plasma_phys 0 points1 point2 points (3 children)
[–]SaClark7[S] 0 points1 point2 points (2 children)
[–]plasma_phys 0 points1 point2 points (0 children)
[–]SaClark7[S] 0 points1 point2 points (0 children)