A
A
Alexander Osherov2020-02-03 16:27:26
Python
Alexander Osherov, 2020-02-03 16:27:26

How to efficiently draw many lines in matplotlib with 2d numpy array?

There are 2 2d arrays, one with x and the other with y lines. For example, x=np.array() y=np.array() how to draw as fast as possible

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2020-02-03
@Araben

import matplotlib.pyplot as plt
import numpy as np
x=np.array() 
y=np.array()
data=zip(*[x,y])
for d in data:
    plt.plot(d[0],d[1])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question