I have a question about this matplotlib‘s example.
Here’s the part that I don’t understand
def update_line(num, data, line):
line.set_data(data[...,:num])
return line,
What does line.set_data(data[...,:num]) do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a special syntax provided by numpy for slicing in multidimensional arrays. The general syntax is
a[s1,s2, ... , sn], wheresiis the expression used for usual slicing or indexing sequences and defines desired slice in i’th dimension. For example,a[5,2:3,1::2].The
...is the shortening for getting full slices in all dimensions. For examplea[...,3]is the shortening fora[:,:,3]ifais three-dimensional.