Ask Your Question
0

list_plot generator

asked 2019-10-08 17:02:55 -0500

JoalHeagney gravatar image

updated 2019-10-08 17:04:03 -0500

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-08 18:30:27 -0500

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 03:40:30 -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

1 follower

Stats

Asked: 2019-10-08 17:02:55 -0500

Seen: 28 times

Last updated: Oct 08