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, 10 Apr 2022 22:43:09 +0200implicit_plot3d string "\n" ignoredhttps://ask.sagemath.org/question/61904/implicit_plot3d-string-n-ignored/I *presume* other plot functions have the same problem.
code clip (I will set up a real executable if it will help)
lim=2
gl=implicit_plot3d(x^2+y^2+z^2==1,(x,-lim,lim),(y,-lim,lim),(z,-lim,lim),color='purple',mesh=True)
gl_a = ('test start'+"\n")
gl += text3d(gl_a + '\n test add'+"\n",[1,1,1] )
gl
Where gl is implicit_plot3d(...._)
I looked around and this works as expected (?)
text("Sage graphics are \n really neat because they use matplotlib!", (2,12))
Whereas this doesn't, I guess it's built in.
text3d("Sage graphics are \n really neat because they use matplotlib!", (2,12,3))
The print output is as intended, but gl plot ignores "\n"
Is there a special syntax for strings in plots?
Do I really have to add (and position) each line separately?
System: Ubuntu mate -- compiled 9.5
I wanted to provide portable and multiple HTML plot pages facilitating comparing plots, and provide enough information in the plots so that they describe themselves; more or less. So the id's don't get forgotten and lost.
Now that I think about it; there are special functions that, I think, said they would combine html "fragments" (what ever they are). Does anybody know about these programs? References are fine.rrogersSun, 10 Apr 2022 22:43:09 +0200https://ask.sagemath.org/question/61904/Sage in console: newline characters?https://ask.sagemath.org/question/10043/sage-in-console-newline-characters/I like to use sage in a linux console, rather than the notebook interface, simply for speed and convenience. However, I have problems if I want to edit a multi-line statement. For example, suppose I enter:
for i in range(10):
if is_prime(i):
print i
If I want to edit this, or maybe just run it again, when I call it up with the history mechanism, what I see is
for i in range(10):^J if is prime(i):^J print i
This can be very inconvenient if there are lots of short lines. (I can get round this by running sage within GNU screen.) I'm not quite sure how I encourage newlines to be interpreted as, well new lines rather than newline characters, and whether this is a sage, ipython, or console issue.AlasdairSat, 20 Apr 2013 01:16:58 +0200https://ask.sagemath.org/question/10043/looping newlinehttps://ask.sagemath.org/question/9343/looping-newline/I am running Sage 5.1 under Windows 7 using the Virtual Box image.
When I enter a gp program with a newline it goes into a loop.
This works:
%gp
lucas(p) ={my(u,q); u=4; q=1<<p - 1;for(k=3,p, u = (sqr(u)-2) % q);u == 0;}
lucas(5)
But this does not:
%gp
lucas(p) ={
my(u,q);
u=4;
q=1<<p - 1;
for(k=3,p, u = (sqr(u)-2) % q);
u == 0;
}
lucas(5)
Can you tell me what I need to do so that I can enter a program on multiple lines?
BrianSat, 22 Sep 2012 20:57:59 +0200https://ask.sagemath.org/question/9343/