Ask Your Question
2

Animate Bar Graph

asked 10 years ago

sagebar gravatar image

updated 10 years ago

vdelecroix gravatar image

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!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

vdelecroix gravatar image

updated 7 years ago

slelievre gravatar image

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

Preview: (hide)
link

Comments

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

sagebar gravatar imagesagebar ( 10 years ago )

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/ja...

vdelecroix gravatar imagevdelecroix ( 10 years ago )

@vdelecroix -- the link in your comment got corrupted by Askbot...

If the corresponding Askbot bug is fixed, the following link should work.

http://nbviewer.jupyter.org/github/ja...

slelievre gravatar imageslelievre ( 7 years ago )

Apparently the Askbot bug is fixed, in that new links at the end of comments work.

This correct behaviour for new posts does not fix links at the end of comments from before the fix.

slelievre gravatar imageslelievre ( 7 years ago )

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: 10 years ago

Seen: 448 times

Last updated: Apr 06 '18