Ask Your Question
0

Animate Bar Graph

asked 2014-11-04 12:39:58 -0500

updated 2014-11-04 14:57:35 -0500

In SAGE, is there a way to use the animate command in conjunction with a bar graph?

I can't seem to get it to work. Let's say for argument's sake I want to have a list of N elements and I want to animate reading in each element and sort them by parity then display the output on a bargraph and then animate this through N iterations.

Thank you!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-04 14:57:16 -0500

Hello,

Sage is not that smart with graphics but it comes with a very nice and complete Python library called matplotlib. You can adapt easily the code from these animation examples.

Vincent

edit flag offensive delete link more

Comments

These don't seem to be working in the SageMathCloud - do you know why this might be?

sagebar gravatar imagesagebar ( 2014-11-04 15:18:39 -0500 )edit

The reason is that the animation is using the window manager. If you want something embedded in a web browser have a look at http://nbviewer.ipython.org/github/jakevdp/matplotlib_pydata2013/blob/master/notebooks/05_Animations.ipynb

vdelecroix gravatar imagevdelecroix ( 2014-11-04 16:47:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-11-04 12:39:58 -0500

Seen: 82 times

Last updated: Nov 04 '14