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.Sat, 10 Jun 2023 17:21:49 +0200Removing the bounding box in parametric plothttps://ask.sagemath.org/question/69093/removing-the-bounding-box-in-parametric-plot/The code to obtain the following nice graph is too long to reproduce it here. Simply is there a way to remove the bounding box ?
![image description](/upfiles/16864104751062529.png)CyrilleSat, 10 Jun 2023 17:21:49 +0200https://ask.sagemath.org/question/69093/How can I plot two parametric functions in a common coordinate system?https://ask.sagemath.org/question/60387/how-can-i-plot-two-parametric-functions-in-a-common-coordinate-system/ I can easily use parametric_plot() to plot 1 parametric function at once. For example
parametric_plot((sin(2*t),cos(3*t)),(t,0.0,9),aspect_ratio=1)
plots a nice Lissajous curve.
I also can plot a circle:
parametric_plot((sin(t),cos(t)),(t,0.0,9),aspect_ratio=1)
But how can I plot both of them in a common coordinate system?
I tried:
parametric_plot([(sin(2*t),cos(3*t)),(sin(t),cos(t))],(t,0.0,9),aspect_ratio=1)
Which doesn't work -> Last error message: ''tuple' object is not callable'
I also tried:
pl1=parametric_plot((sin(t),cos(t)),(t,0.0,9),aspect_ratio=1)
pl2=parametric_plot((sin(2*t),cos(3*t)),(t,0.0,9),aspect_ratio=1)
pl1.add_primitive(pl2)
pl1
Error: 'Graphics' object has no attribute 'options'
Then how can I use parametric_plot() to plot two parametric functions at once, in a common coordinate system?
KonstantinWed, 22 Dec 2021 23:45:43 +0100https://ask.sagemath.org/question/60387/A parametric plot with branches for which restricting the range with xmin, xmax doesn't workhttps://ask.sagemath.org/question/60087/a-parametric-plot-with-branches-for-which-restricting-the-range-with-xmin-xmax-doesnt-work/Hi
The following plot
var('t')
parametric_plot( (8*(6+t)/(t^2-16), 2*(8+ 3 *t)/(t^2-16)), (t, -6, 6),xmin=-3,xmax=3,detect_poles=True)
has three branches. 1) For some reason, the plot is not correct. Also
var('t')
parametric_plot( (8*(6+t)/(t^2-16), 2*(8+ 3 *t)/(t^2-16)), (t, -6, 6),xmin=-3,xmax=3,ymin=-3,ymax=3)
fails. 2)How to plot the branches in different colors? 3) Can I add a point moved by a cursor when t increases, like with the Mathematica command Manipulate? Or make an animation to show how a point traverses the three branches?florinSat, 04 Dec 2021 20:12:17 +0100https://ask.sagemath.org/question/60087/xmin and xmax doesn't work within parametric plot.https://ask.sagemath.org/question/56701/xmin-and-xmax-doesnt-work-within-parametric-plot/ Restricting the range with `xmin` and `xmax` doesn't work with parametric plot. Here's the code,
cs_01 = parametric_plot([fresnel_cos(t), fresnel_sin(t)], (t, -1.5*pi, 1.5*pi), ticks=[pi/8, 0.2], tick_formatter=[pi, None], axes_labels=['$x(t)$', '$y(t)$'], axes_labels_size=1.5, plot_points=500, xmin=-pi/4, xmax=pi/4, ymin=-0.8, ymax=0.8, fontsize=12)
cs_01_text_01 = text(r'$x(t) = \int_0^t\cos(\frac{\pi u^2}{2})du$', (-pi/2,0.8), fontsize=13, color='black', bounding_box={'boxstyle':'round', 'fc':(0.9,0.9,0.9), 'ec':'w'})
cs_01_text_02 = text(r'$y(t) = \int_0^t\sin(\frac{\pi u^2}{2})du$', (-pi/2,0.4), fontsize=13, color='black', bounding_box={'boxstyle':'round', 'fc':(0.9,0.9,0.9), 'ec':'w'})
cs_01_text_03 = text('Clothoid or Cornu spiral', (0, 1.15), fontsize=14, color='black', fontweight='bold')
cs_01 + cs_01_text_01 + cs_01_text_02 + cs_01_text_03
But when provided within `show` it works,
cs_01 = parametric_plot([fresnel_cos(t), fresnel_sin(t)], (t, -1.5*pi, 1.5*pi), ticks=[pi/8, 0.2], tick_formatter=[pi, None], axes_labels=['$x(t)$', '$y(t)$'], axes_labels_size=1.5, plot_points=500, ymin=-0.8, ymax=0.8, fontsize=12) + \
text(r'$x(t) = \int_0^t\cos(\frac{\pi u^2}{2})du$', (-pi/2,0.8), fontsize=13, color='black', bounding_box={'boxstyle':'round', 'fc':(0.9,0.9,0.9), 'ec':'w'}) + \
text(r'$y(t) = \int_0^t\sin(\frac{\pi u^2}{2})du$', (-pi/2,0.4), fontsize=13, color='black', bounding_box={'boxstyle':'round', 'fc':(0.9,0.9,0.9), 'ec':'w'}) + \
text('Clothoid or Cornu spiral', (0, 1.15), fontsize=14, color='black', fontweight='bold')
cs_01.show(xmin=-pi/4, xmax=pi/4)
I don't know why it's happening. Is it supposed to work like that?debojit2178Sun, 18 Apr 2021 04:58:43 +0200https://ask.sagemath.org/question/56701/no linewidth with parametric plothttps://ask.sagemath.org/question/8030/no-linewidth-with-parametric-plot/It seems that there is no option for linewidth in parametric_plot. (2D in my case.) Is that true? Any way to make the graph thicker?finottiMon, 28 Mar 2011 18:41:32 +0200https://ask.sagemath.org/question/8030/Errors when plotting zeta function parametricallyhttps://ask.sagemath.org/question/34882/errors-when-plotting-zeta-function-parametrically/ I have the following piece of code:
def f(x):
return(real_part(zeta(1+x*I)).n())
def g(x):
return(imag_part(zeta(1+x*I)).n())
parametric_plot([f(x),g(x)], (x,2,10))
It should be moderately clear what I'm trying to do - I want to produce a plot of Riemann zeta function on the line Re(z)=1 using parametric plotting. However, when I try to plot this, I get an error `TypeError: cannot evaluate symbolic expression numerically`. I also tried the same thing without the `.n()`, but then I get an error `TypeError: unable to coerce to a real number`. I couldn't find any help online.
It's worth noting that trying to plot function f(x) I get the same error with `.n()`, but it works just fine without it (as opposed to parametric plot). Does anyone have an idea how to fix the issue?
Thanks in advance.WojowuWed, 21 Sep 2016 16:46:11 +0200https://ask.sagemath.org/question/34882/plotting a plane section in sagehttps://ask.sagemath.org/question/24867/plotting-a-plane-section-in-sage/ Suppose I have a parametric surface given by three functions in two variables. Moreover, this surface is immersed in a solid torus like
sage: p1 = parametric_plot(( a*(R + x)*cos(z), a*(R + y)*sin(z), a*y ),(p,0,2*pi),(q,0,2*pi))
for some a and R.
How can one plot a section of the surface by a plane with Sage?uglychamaeleonFri, 14 Nov 2014 21:55:50 +0100https://ask.sagemath.org/question/24867/How can I Change the background color of a plot.https://ask.sagemath.org/question/11361/how-can-i-change-the-background-color-of-a-plot/I want to create some plots using sage to then save them in my computer. I don't want the background to be white (or transparent). Is there a way of specifying the background of a plot inside sage?
(I'm looking for an option of the form:
sage: t=var('t')
sage: p=parametric_plot((t,2*t), (t, -5, 5))
sage: p.show(background=(.1,.2,.3))
or something like that.)RaulFri, 25 Apr 2014 14:21:00 +0200https://ask.sagemath.org/question/11361/multiple parametric_plot's with for loophttps://ask.sagemath.org/question/8988/multiple-parametric_plots-with-for-loop/I'm studying differential geometry of curves and surfaces, and I have a question regarding multiple plots on one graphics, that is i want to plot multiple lines on one plot in for loop, but when I try to do that it shows only the last plot...
a,b,v,u = var('a b v u'); rectangular=(a,b,v);
z=0;
for i in range(81):
z=i*pi/20;z
pt=plot3d(z*v,(v,0,5),(a,0,5),(b,0,5),transformation=rectangular,plot_points=80,color="blue")
show(pt)markisaMon, 21 May 2012 06:47:33 +0200https://ask.sagemath.org/question/8988/there are more variables than variables rangeshttps://ask.sagemath.org/question/8895/there-are-more-variables-than-variables-ranges/trying to solve a parametric plot problem but Sage won't let me graph function because it says I have more variables than variable ranges. Can someone help me fix this problem.johnt18Fri, 20 Apr 2012 06:40:51 +0200https://ask.sagemath.org/question/8895/get_minmax_data too generosous ?https://ask.sagemath.org/question/8867/get_minmax_data-too-generosous/Hello
I'd like to understand the rationale behind the `ymin` value in the get_minmax_data of a parametric curve that have always y=0:
sage: f(x)=sin(x)
sage: g(x)=0
sage: P=parametric_plot((f,g),(-pi/2,2*pi))
sage: P.get_minmax_data()['ymin']
-1.0
I would have expected ymin to be 0. Is is a bug or is it something I don't understand ?
Laurent ClaessensSun, 08 Apr 2012 11:32:35 +0200https://ask.sagemath.org/question/8867/complex numbers and parametric curveshttps://ask.sagemath.org/question/8739/complex-numbers-and-parametric-curves/I would like to be able to plot a 2d parametric plot of zeta(t+I), -2 <= t <= 2, where I is the square root of -1.
But complex numbers and parametric plots seem to barf at each other.
I tried many variants of the following code:
parametric_plot( (zeta(t+I).real(), zeta(t +I).imag()), (t, -2, 2))
But I get the following kind of response:
TypeError: Unable to convert 1.00000000000000*I to float; use abs() or
real_part() as desired
bbartlettSun, 26 Feb 2012 04:09:02 +0100https://ask.sagemath.org/question/8739/How do I plot parametric and polar curveshttps://ask.sagemath.org/question/8450/how-do-i-plot-parametric-and-polar-curves/How do I "ask" or input a command line for parametric and polar curves with other variables than x such as r, (theta), y etc?
thank youdoladimejiMon, 07 Nov 2011 16:19:46 +0100https://ask.sagemath.org/question/8450/GRE Math Subject Test Sample Question #1https://ask.sagemath.org/question/7731/gre-math-subject-test-sample-question-1/What is the length of the parametric curve: f(t) = (x,y) = (cos(t),sin(t)), for t in [0,Pi] ?
Update: Mike got the answer lightning-/mike-fast. Here's the output of parametric_plot() below:
![alt text][2]
Update 2: Per Mitesh's suggestion, I called parametric_plot() with keyword argument "aspect_ratio=1"; the image below looks more round with a 1:1 aspect ratio:
![alt text][1]
[1]: /upfiles/12873540266117765.png
[2]: /upfiles/12873516345197655.pngccanoncSun, 17 Oct 2010 16:33:15 +0200https://ask.sagemath.org/question/7731/