issue_comments: 377439646
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/2030#issuecomment-377439646 | https://api.github.com/repos/pydata/xarray/issues/2030 | 377439646 | MDEyOklzc3VlQ29tbWVudDM3NzQzOTY0Ng== | 13205162 | 2018-03-30T04:02:24Z | 2018-03-30T04:16:17Z | CONTRIBUTOR | Unfortunately I don't have any example with DataArray right now. Since I never could take advantage of DataArray's plotting capabilities for animations, I always did animations using pure Numpy. However, I'm talking about the standard matplotlib animations. Here's an example taken from here: ```import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.animation as animation def update_line(num, data, line): line.set_data(data[..., :num]) return line, Set up formatting for the movie filesWriter = animation.writers['ffmpeg'] writer = Writer(fps=15, metadata=dict(artist='Me'), bitrate=1800) fig1 = plt.figure() data = np.random.rand(2, 25) l, = plt.plot([], [], 'r-') plt.xlim(0, 1) plt.ylim(0, 1) plt.xlabel('x') plt.title('test') line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l), interval=50, blit=True) line_ani.save('lines.mp4', writer=writer) ``` If you have some directions on a smart way to bring xarray into the picture, maybe I can try to come up with an example that might evolve into a contribution. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
309965118 |