ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 09 Oct 2019 03:40:30 -0500list_plot generatorhttps://ask.sagemath.org/question/48239/list_plot-generator/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.Tue, 08 Oct 2019 17:02:55 -0500https://ask.sagemath.org/question/48239/list_plot-generator/Answer by tmonteil for <p>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.</p>
<p>When I pass the generator to list_plot, I get an error as list_plot only accepts lists, tuples and dictionaries.</p>
<p>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)?</p>
<p>If not, I'm planning to request an enhancement to list_plot, if at all possible.</p>
https://ask.sagemath.org/question/48239/list_plot-generator/?answer=48240#post-id-48240How 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.
Tue, 08 Oct 2019 18:30:27 -0500https://ask.sagemath.org/question/48239/list_plot-generator/?answer=48240#post-id-48240Comment by JoalHeagney for <p>How large is <code>n</code> ?</p>
<p>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.</p>
https://ask.sagemath.org/question/48239/list_plot-generator/?comment=48242#post-id-48242I was hoping that list_plot's biggest memory component was just an image, not a dynamic object. I'm assuming this is not true?Wed, 09 Oct 2019 03:40:30 -0500https://ask.sagemath.org/question/48239/list_plot-generator/?comment=48242#post-id-48242