First time here? Check out the FAQ!

Ask Your Question
0

list_plot generator

asked 5 years ago

JoalHeagney gravatar image

updated 5 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 5 years ago

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.

Preview: (hide)
link

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 ( 5 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

1 follower

Stats

Asked: 5 years ago

Seen: 779 times

Last updated: Oct 09 '19