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.Sun, 04 Mar 2018 17:28:19 +0100How to specify x and y axis values in Sage plot?https://ask.sagemath.org/question/41393/how-to-specify-x-and-y-axis-values-in-sage-plot/So, I have three lists in Sage, and I want to combine two list plots, where in one of them I have the expected values, and in the other one I have the simulation results, and the third one is the x-axis values that corresponds to these points. So my lists (all same size), look like this:
# all lists removed partially for brevity
expected = [47.4246, 47.9955, 95.9383]
simulated = [47.2, 48, 96]
primes = [23327, 3009311, 886463]
# plotting
p = list_plot(expected, color='blue', marker='o') + list_plot(simulated, color='red', marker='x')
p.save('plot.svg')
Now, this creates a plot, and the y-axis corresponds to the values in `expected` and `simulated` lists, but I do not know how to incorporate the values in `primes` to the x-axis. So that I have 47.4246 for expected and 47.2 for simulated in the y-axis when I have 23327 in x-axis, and so on. Any ideas how to do this in Sage?ninhoSun, 04 Mar 2018 17:28:19 +0100https://ask.sagemath.org/question/41393/how to get a log distribution on the x-axis of a semilogx plot?https://ask.sagemath.org/question/24310/how-to-get-a-log-distribution-on-the-x-axis-of-a-semilogx-plot/I tried to plot some frequency response. In the most simple case this may look like A(w). I can make plots using different statements like plot_semiogx, or plot(...,scale='semilogx') etc, but the results look odd. Apparently the internally generated points on the x-axis lways have a linear distribution. Only forcing an exaggerated number of points (e.g. plot_points=100000) results in a correct graph. I didn't find a better solution. I think the plot command should distribute the x-points in a log-fashion automatically for semilogx and loglog plots, thus I consider this a bug. I'm using sage 6.2 right now. Any ideas how to workaround/fix this?
w = var('w')
A0=1e7
w0=100
A(w)=A0*(1/(1+i*w/w0))
plot_semilogx(abs(A(w)),1,1e7)gg@gSat, 27 Sep 2014 15:32:32 +0200https://ask.sagemath.org/question/24310/date x-axishttps://ask.sagemath.org/question/10792/date-x-axis/i need to plot a graph with bubbles : y-axis is a data, size is another one, in x i need to put date. How is it possible? What's the date format?
An exemple:
azerty=[(131118,43,16), (131118,43,10), (131118,46,8), (131118,43,15), (131118,38,19)]
dvorak=[(131119,7,25), (131120,6,14), (131120,7,26), (131121,7,28), (131121,8,26), (131122,9,18), (131123,9,26), (131123,10,23), (131123,11,17), (131124,12,14), (131124,12,15), (131124,11,25), (131124,12,12), (131124,12,15), (131124,12,20), (131125,9,17), (131125,10,18), (131125,13,9), (131126,13,6), (131126,13,11), (131126,13,8), (131127,13,12), (131127,12,16), (131127,15,12), (131127,16,10), (131127,14,9), (131127,13,19), (131127,13,14), (131127,12,14), (131127,13,11), (131127,13.2,17), (131127,12,19), (131127,11,22), (131128,13,9), (131128,15,17), (131128,15,14), (131128,14,18), (131128,14,12), (131128,13,22), (131128,13,13), (131128,14,11), (131128,15,16), (131129,14,14), (131129,13,16), (131129,14,9), (131129,14,15), (131130,17,12), (131130,18,8), (131130,13,18), (131130,16,26), (131130,16,14), (131130,16,15), (131201,14,9), (131201,16,12), (131201,15,13), (131201,14,14)]
P=text('words/minutes',(131150,5))
for x in azerty:
P=P+circle((x[0],x[1]/10), x[2]/50, fill=True, edgecolor='blue', rgbcolor='blue', alpha=0.15)
for x in dvorak:
P=P+circle((x[0],x[1]/10), x[2]/50, fill=True, edgecolor='green', rgbcolor='green', alpha=0.15)
P.plot()yeKcimMon, 02 Dec 2013 06:57:22 +0100https://ask.sagemath.org/question/10792/