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.Thu, 16 Aug 2012 13:42:33 +0200Solid lines in plot and grid lineshttps://ask.sagemath.org/question/9244/solid-lines-in-plot-and-grid-lines/I have a plot which sweeps over a range shown below and the plots it on a log scale on the horizontal axis (I am using 5.2 so the log scale feature is present).
1. However, rather than points, I would like to see a solid line and,
2. Some grid lines on both the horizontal and vertical axis at the tick points.
3. Is there also a way to control the range on the vertical axis?
Here is the entire formulation. The range on the y-axis I would like to see labeled is from -5 to -25. I asked a question before using the formulation below but the scale did not was off due to the wrong operator being used so I did not ask that particular question at the time:
z1=2 * pi * 650 * 10^6
p1=2 * pi * 1.9 * 10^9
p2=2 * pi * 5 * 10^9
adc=.667
deltaF=.2 * 10^9
N=(adc * p1 * p2)/z1
M(freq)=(-2 * i * pi * freq + z1)/((-2 * i * pi * freq+p1) * (-2 * i * pi * freq+p2))
g(frq)=20 * abs(log(N * M(frq),10))
pts=[(frq,g(frq).n()) for frq in srange(10^8,10^11,deltaF)]
list_plot(pts, scale='semilogx')Thu, 16 Aug 2012 11:42:11 +0200https://ask.sagemath.org/question/9244/solid-lines-in-plot-and-grid-lines/Answer by achrzesz for <p>I have a plot which sweeps over a range shown below and the plots it on a log scale on the horizontal axis (I am using 5.2 so the log scale feature is present). </p>
<ol>
<li>However, rather than points, I would like to see a solid line and,</li>
<li>Some grid lines on both the horizontal and vertical axis at the tick points.</li>
<li>Is there also a way to control the range on the vertical axis? </li>
</ol>
<p>Here is the entire formulation. The range on the y-axis I would like to see labeled is from -5 to -25. I asked a question before using the formulation below but the scale did not was off due to the wrong operator being used so I did not ask that particular question at the time:</p>
<pre><code>z1=2 * pi * 650 * 10^6
p1=2 * pi * 1.9 * 10^9
p2=2 * pi * 5 * 10^9
adc=.667
deltaF=.2 * 10^9
N=(adc * p1 * p2)/z1
M(freq)=(-2 * i * pi * freq + z1)/((-2 * i * pi * freq+p1) * (-2 * i * pi * freq+p2))
g(frq)=20 * abs(log(N * M(frq),10))
pts=[(frq,g(frq).n()) for frq in srange(10^8,10^11,deltaF)]
list_plot(pts, scale='semilogx')
</code></pre>
https://ask.sagemath.org/question/9244/solid-lines-in-plot-and-grid-lines/?answer=13933#post-id-13933 list_plot(pts, scale='semilogx',plotjoined=True,ymin=2,ymax=20,gridlines=[[10^9,10^10],[5,10,15]]) Thu, 16 Aug 2012 13:42:33 +0200https://ask.sagemath.org/question/9244/solid-lines-in-plot-and-grid-lines/?answer=13933#post-id-13933