Ask Your Question
0

list_plot generator

asked 2019-10-09 00:02:55 +0100

JoalHeagney gravatar image

updated 2019-10-09 00:04:03 +0100

I have created a python generator that yeilds a list of single values (e.g. like [1,971,15,341,..]) up to some defined length of n,and wanted to plot them in sagemath.

When I pass the generator to list_plot, I get an error as list_plot only accepts lists, tuples and dictionaries.

Is there any way to get the list_plot behaviour from a generator without converting to a list first (To memory-hungry for my purpose)?

If not, I'm planning to request an enhancement to list_plot, if at all possible.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-10-09 01:30:27 +0100

tmonteil gravatar image

How large is n ?

The thing is that the size of the plot will be larger than the size of the list, and the plot also has to fit in memory. So, if the list does not fit into the memory, there is no way to plot all its points.

edit flag offensive delete link more

Comments

I was hoping that list_plot's biggest memory component was just an image, not a dynamic object. I'm assuming this is not true?

JoalHeagney gravatar imageJoalHeagney ( 2019-10-09 10:40:30 +0100 )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

1 follower

Stats

Asked: 2019-10-09 00:02:55 +0100

Seen: 634 times

Last updated: Oct 09 '19