ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 09 Oct 2019 00:02:55 +0200list_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.JoalHeagneyWed, 09 Oct 2019 00:02:55 +0200https://ask.sagemath.org/question/48239/Formatting Plots (list_plot)https://ask.sagemath.org/question/25940/formatting-plots-list_plot/ Hi All,
Sorry if this is going to be a silly question, but being new to Sage, I am struggling to find answers. I am creating a plot using list_plot (its a zip of two lists). Actually, I have 2 plots overlaid, which works fine.
I just can't figure out how to format the plot. I want to be in control of:
* Scales of axis (e.g. my x-axis is 0-360, but the divisions by default are in 50s. I want to show 0/90/180/270/360)
* the divisions of th Y axis, say every 500. Can you control both major and minor ticks?
* The linestyle of both individual plots
So I am just unsure how to do this formatting, especially with list_plot(), as all the documentation I have found is based on just plot()
Thanks in advance.j0nrThu, 26 Feb 2015 11:58:20 +0100https://ask.sagemath.org/question/25940/Overlaying plots in a specific orderhttps://ask.sagemath.org/question/8510/overlaying-plots-in-a-specific-order/I've got two plots: one is a density plot, one is a list plot. I'd like to combine the plots in such a way that the list plot is overlaid on top of the density plot, so the dots or visible. No matter what I do, it seems that the density plot is always in front and list plot is in back.
This isn't my code, but it appears to have the same behavior:
sage: x_coords = [cos(t)^3 for t in srange(0, 2*pi, 0.02)]
sage: y_coords = [sin(t)^3 for t in srange(0, 2*pi, 0.02)]
sage: h1 = list_plot(zip(x_coords, y_coords))
sage: x,y = var('x,y')
sage: h2 = density_plot(sin(x)*sin(y), (x, -2, 2), (y, -2, 2), cmap='jet')
sage: h1+h2
How can I make the list plot on top (or in general, specify the order of any combined plots)? JasonThu, 24 Nov 2011 18:51:40 +0100https://ask.sagemath.org/question/8510/