Hello i know that this way to plot in matlab works:
subplot(2,2,[1, 2])
plot(Tabsauv(:, 2:2:2*Ntracks), Tabsauv(:, 3:2:(2*Ntracks+1)),couleur,'LineWidth',2, 'MarkerSize', 2)
grid('on')
hold on
When Tabasauv is a table of values.
I'm a new beginner in python, I tried to plot this in this way with python but it still not working, any idea?
80 Ntracks=5
81 fig= plt.figure()
82 ax=fig.add_subplot(1,1,1)
83
84 data_1=np.array([:,2:2:(2*Ntracks)])
85 data_2=np.array([:,3:2:(2*Ntracks+1])
86 points = data[:,2:4]
87
88 color = np.sqrt((points**2).sum(axis = 1))/np.sqrt(2.0)
89 rgb = plt.get_cmap('jet')(color)
90
91 ax.scatter(data_1, data_2, color = rgb)
92 plt.show()
I got this error caus' i don't know how to translate it in python:
data_1=np.arange([:,2:2:(2*Ntracks)])
^
SyntaxError: invalid syntax
Thank you.
np.arange([:,2:2:(2*Ntracks)])to be. As it is, I addednumpyandmatlabto your tags so you might find someone who knows both (matlab was too many years ago for me).