Ask Your Question

al's profile - activity

2024-03-17 20:45:11 +0200 received badge  Famous Question (source)
2023-08-16 13:53:19 +0200 received badge  Notable Question (source)
2023-01-24 18:06:34 +0200 received badge  Notable Question (source)
2023-01-24 18:06:34 +0200 received badge  Popular Question (source)
2022-03-14 15:13:05 +0200 received badge  Famous Question (source)
2021-12-19 16:29:17 +0200 received badge  Popular Question (source)
2021-03-30 22:51:56 +0200 received badge  Popular Question (source)
2021-02-15 00:50:11 +0200 received badge  Popular Question (source)
2021-02-15 00:50:11 +0200 received badge  Notable Question (source)
2020-10-10 18:25:18 +0200 received badge  Notable Question (source)
2020-04-27 14:40:22 +0200 received badge  Popular Question (source)
2020-04-25 22:06:16 +0200 commented question How to save 3d plot as rotatable html file

Fantastic, it worked!!! On CoCalc there is an option to create a Sagemath notebook with version 9.0. So I pasted the code in there, with three.js viewer, and could save the 3d- html file!!!

Thanks again!

(I would still like to be able to do this with jmol, but that gives an error also with Sage 9.0. So if jmol could be made to work there, OR if jmol in the Jupyter notebook could be made to run better- so the menu works, as it does on SageCell, and so it is possible to save the 3d- html.... OR if all this could work on SageCell...)

2020-04-25 20:44:50 +0200 commented question How to save 3d plot as rotatable html file

Thanks very much for the sugestion; I will try to reinstall it- it had stopped working at some point!

So you use three.js rather than jmol? Why is that? In my graphic the jmol image turns out better... also, the stereo pairs option is really cool (I use the walleyed view, as I can see that one in 3d by de-focussing my eyes and letting the images join together) and, as I mentioned, I see that poeple have successfully made 3d-animations using jmol.

2020-04-24 00:34:17 +0200 commented question How to save 3d plot as rotatable html file

PPS a further dream would be to produce rotatable stereo pair views, and also animated...

2020-04-23 23:53:23 +0200 commented question How to save 3d plot as rotatable html file

PS If I can figure out how to save as html, the next step I want to do is to create a 3d film which I know is possible for molecules in Jmol. I don't know if that is compatible with Sagemath. What I mean by 3D film is a 3d image which can be grabbed and rotated, as the film runs. An example is here under "Animation".

2020-04-23 23:48:18 +0200 commented question How to save 3d plot as rotatable html file

Thanks RyanG for the suggestion! I am not sure what you mean by "a Sage terminal".

I had installed sagemath on my notebook (a Mac) but it hasn't been working well for a while so I switched to CoCalc.

I thought maybe you meant a SageCell so I pasted my code into a SageCell. This ran fine, and now doing ctrl-click (on a Mac) opens up a menu for Jmol. In CoCalc the menu appeared but was inactive. So that is already really cool: I can produce stereo views, rotate at a constant speed. Also I can Export- say to X3D but I haven't figured that out yet.

There is no icon to save as html.

I then tried pasting the code into a sage notebook instead of a jupyter notebook in CoCal. This is worse: jmol as viewer gives error messages and so I used the default ... (more)

2020-04-21 03:47:57 +0200 asked a question How to save 3d plot as rotatable html file

I'm using SAGEMATH in a Jupyter notebook on CoCalc. I have a rotatable 3d image and I want to save it as such.

If I go to (Grey) File/Download as html If I "EXPORT AS HTML" and click this now opens in the browser. Then I can scroll down to a particular 3d plot and click on the download error to the lower right of the image, and thereby take a nice screenshot with the perspective indicated.

What I want to do is save the html file of just this image, not the whole notebook. I know this is possible because I did it a year ago- but forgot to take notes on what worked, and have forgotten how!

Some of my plots I did with threejs and some with the default (not sure what that is). Both work in the same way.

Thanks for any suggestions!

2018-11-20 01:55:41 +0200 asked a question Question (and answer) about deepcopy in Sage

This was driving me crazy but I just found the answer, slightly different from what I found in a link below. I will explain. I hope it may be useful to other beginners!

If you have a list of numbers and want to change one, but save the old list, no problem; you can use = as follows:

T=[1,2,3]

S=T

S[0]=5

now you find that S= [5,2,3] while T= [1,2,3]

If you do this with a list of lists, changing T changes S also, as they are identified. The way to solve this is with the copy command, either

S=T[:]

or

S=copy(T).

However, if T is a list of lists of lists, which is very easy to come across, you are in trouble. There is a Python command called "deepcopy" which deals with this.

See https://stackoverflow.com/questions/2...

The point I just discovered is that to use this instead of e.g. S=copy.deepcopy(T) as suggested in the link -- this gave me an error message!!! --maybe it's ok in Pythin?? what works in SAGEMATH is simply S=deepcopy(T).

example:

T=[] S=[]

T=[[1],[2],[3]]

S=T[:]

(or equivalently S=copy(T) )

then if you do

S[0][0]=5

now both S and T are [[5],[2],[3]].

if instead you do

S= deepcopy(T)

as suggested by the links (slight modification) then this works!!! The explanation for why is in the links.

2018-11-18 21:10:45 +0200 received badge  Self-Learner (source)
2018-11-18 21:10:45 +0200 received badge  Teacher (source)
2018-11-18 17:05:50 +0200 answered a question question about Python assignment of lists; meaning of equals sign; how to save a list?

I think I just found what the problem is: "This is really a matter of how Python handles assignments of lists."

Here is the solution:

sage: L1 = [1, 2]
sage: L2 = [3, 4]
sage: L1
[1, 2]
sage: L2
[3, 4]
sage: L1.extend(L2)
sage: L1
[1, 2, 3, 4]
sage: L2
[3, 4]
sage: L3 = L1[:]
sage: L3
[1, 2, 3, 4]
sage: L1.append(8)
sage: L1
[1, 2, 3, 4, 8]
sage: L3
[1, 2, 3, 4]

I found the explanation in @calc314's answer to Ask Sage question 25998 by @ikol.

2018-11-18 15:59:29 +0200 asked a question question about Python assignment of lists; meaning of equals sign; how to save a list?

I have a list, then modify it, but want to save the old list to then modify in a different way. I try to save the original using a different name and =, but it seems the two names are forever linked by the equals sign, so the modification also changes the original. Why does this happen, and how do I deal with this?

Example:

sage: L1 = [1, 2]
sage: L2 = [3, 4]
sage: L3 = L1
sage: L1
[1, 2]
sage: L2
[3, 4]
sage: L3
[1, 2]
sage: L1.extend(L2)
sage: L1
[1, 2, 3, 4]
sage: L2
[3, 4]
sage: L3
[1, 2, 3, 4]

The same thing happens with "append".

Help please!!!

Note: this does not happen with variables with numerical (not list) values. For example:

sage: a = 4
sage: b = a
sage: a = 5
sage: a
5
sage: b
4

So it seems that the equals sign means two different things: for numbers it is an assignment; for lists it is an identification. This is driving me crazy. I cannot find it explained anywhere (maybe because it is so "well-known"?)

2018-03-27 21:28:59 +0200 received badge  Notable Question (source)
2018-02-07 21:35:32 +0200 commented answer How do you get a 2d version of a 3d plot?

how0 b = show0(a) File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2625, in show0 salvus.threed(obj, **kwds) TypeError: threed() got an unexpected keyword argument 'viewer'

2018-02-07 21:35:23 +0200 commented answer How do you get a 2d version of a 3d plot?

I am actually using three.js (it says "canvas" below the plot). I tried Tachyon and got an image of much worse quality, and tried jmol but got an error message: Error in lines 76-76 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/plot/plot3d/base.pyx", line 1478, in sage.plot.plot3d.base.Graphics3d.show (build/cythonized/sage/plot/plot3d/base.c:21473) dm.display_immediately(self, **kwds) File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2678, in show s = show0(objs, combine_all=True) File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_salvus.py", line 2639, in s

2018-02-04 01:36:01 +0200 commented question Notebook problems

Yes, I use /Applications/SageMath-7.2.app/Contents/Resources/sage/sage; exit then notebook()

Not sure how to test what you suggest, can you be more explicit? Thanks !!

2018-02-03 14:16:47 +0200 answered a question Save 3d plot as vector format

I had the same question. The screen capture suggested by calc314 worked fine, thank you! But I wonder how much quality is lost, and whether a more direct output to pdf wouldn't be better. I tried Tachyon but the result was much worse- axes had been shifted, a transparent surface had disappeared....!!!

In fact, when people illustrate textbooks, do they sometimes use Sagemath, or do they always switch to Mathematica or Maple or something partly because of this issue ?

2018-02-02 22:09:34 +0200 commented question Notebook problems

Morecomments: In answer to the comment: I have SAGE 7.2 installed on my mac with OSX 10.10.5. It opens in the Firefox browser. To install it I downloaded the Mac OSX binaries fior which it says Download Mac OS X binaries "These binaries are only for OS X 10.4 - 10.10. " from this page: http://www.sagemath.org/download.html

I am using the Sage notebook. There is no error message- it just doesn't work anymore, as described above. The "Discard and Quit" and Delete" buttons also don't work. If I open a file, it is marked (running) but Stpo doesn't stop it. To stop it, I can logout, then I start sage from terminal, kill the old PID, type notebook() and I see all the files, none are running.

2018-02-02 21:59:06 +0200 commented question Sage notebook frozen

In answer to the comment: I have SAGE 7.2 installed on my mac with OSX 10.10.5. It opens in the Firefox browser. To install it I downloaded the Mac OSX binaries fior which it says Download Mac OS X binaries "These binaries are only for OS X 10.4 - 10.10. " from this page: http://www.sagemath.org/download.html

I am using the Sage notebook. There is no error message- it just doesn't work anymore, as described above. The "Discard and Quit" and Delete" buttons also don't work. If I open a file, it is marked (running) but Stpo doesn't stop it. To stop it, I can logout, then I start sage from terminal, kill the old PID, type notebook() and I see all the files, none are running.

2018-02-02 21:26:19 +0200 commented question Sagemath notebook stopped working

In answer to the first comment: I have SAGE 7.2 installed on my mac with OSX 10.10.5. It opens in the Firefox browser. To install it I downloaded the Mac OSX binaries fior which it says
Download Mac OS X binaries "These binaries are only for OS X 10.4 - 10.10. " from this page: http://www.sagemath.org/download.html

2018-02-02 21:16:49 +0200 commented question Sage notebook frozen

Thanks Thierry I'll check on it and try to reply.

2018-02-02 21:15:47 +0200 commented question Sagemath notebook stopped working

Thanks for your comments, I'll work on those and reply.

2018-02-02 21:13:09 +0200 asked a question Notebook problems

I am asking this for the third time with more details, since there are no answers yet. Since my notebook isn't working, I am using the Cloud, but I'd like to get the notebook running again.

So, I have sagemath notebook installed on my Mac laptop, and it has been working fine until recently, maybe because I tried to run some 3d graphics program I found on the Sagemath manual. Then it froze up.

I can see all my files, but I cannot run any programs. There is no "evaluate" button. The box for a new program doesn't turn blue around the edge. If I open up a worksheet, and go back to the list of files, it says (running), though nothing is working. Also, the "Help" and "Report a Problem" and "log" buttons don't work. "Home" and "Sign Out" do.

I can sign out, log back in and it's still stuck. Restarting the Mac also doesn't help. Do I have to create a new notebook? Reinstall everything?

Help please !!!

thanks very much

2018-02-02 12:22:53 +0200 commented answer How to save a 3d plot from sage cell

Very interesting answers. Now the issue I have is how to get the 3d capability on the notebook on my computer- any hints? It runs in the cloud but not on my own notebook version so far.

2018-02-02 12:20:37 +0200 commented answer How to save graphics into an image in sagemath online?

I had the same question and tried this. It worked (sort of) but the resulting image had been changed in strange ways, and also there is no option to rotate/zoom to the view you want. The picture I got from screenshot was much better quality. It's hard to believe this is not built into Sagemath- how does anyone use Sagemath for making high-quality illustrations for a paper or a book?

2018-02-01 15:16:06 +0200 asked a question How do you get a 2d version of a 3d plot?

I am working on Cocalc. I would like to get a nice pdf of the view I want after rotating and zooming. Yes, taking a screenshot works, but is there a better method? Thanks !