Ask Your Question

niles's profile - activity

2017-06-16 12:43:32 -0500 marked best answer use a colormap for implicit_plot3d

Here's a question I asked a while ago on sage-support, but never got answered, so I'll try it again here:

I've been trying to figure out how to plot a surface using implicit_plot3d, and color it according to a particular color map. I see that implicit_plot3d passes its arguments to

sage.plot.plot3d.implicit_plot3d.ImplicitSurface

but I can't figure out more than this . . . when I try

sage: sage.plot.plot3d.implicit_plot3d.ImplicitSurface??

I get

Error getting source: could not find class definition

and then a few more unhelpful details.

It seems like the two possible viewers are jMol and Tachyon, but I can't tell whether either of these support color maps.

Any ideas where else I should be looking?

Update: This is now Trac ticket 12212

2017-06-02 15:09:16 -0500 commented answer Export Answer To Text File

There must be something wrong with the file path; try something simpler, like just f=open('test.txt', 'w') to see if that works. I think you can use the command pwd from the sage prompt to show the current working directory as a path.

2017-04-26 16:00:52 -0500 received badge  Famous Question (source)
2017-03-24 04:26:21 -0500 received badge  Great Answer (source)
2017-02-22 20:18:13 -0500 received badge  Famous Question (source)
2017-02-21 22:58:54 -0500 received badge  Good Answer (source)
2017-02-08 16:32:44 -0500 received badge  Great Answer (source)
2016-12-03 22:32:11 -0500 received badge  Good Answer (source)
2016-11-05 05:37:53 -0500 received badge  Necromancer (source)
2016-11-05 05:37:26 -0500 received badge  Nice Answer (source)
2016-11-05 05:36:57 -0500 received badge  Nice Answer (source)
2016-11-02 21:37:36 -0500 received badge  Necromancer (source)
2016-11-02 20:57:24 -0500 received badge  Nice Answer (source)
2016-11-02 16:23:26 -0500 received badge  Necromancer (source)
2016-11-02 15:52:03 -0500 received badge  Nice Answer (source)
2016-11-02 15:52:03 -0500 received badge  Good Answer (source)
2016-10-17 13:31:27 -0500 marked best answer Will upgrading to Python 3.x on my system break Sage?

I want to use Python 3.2 for some other things, but I know that Sage does not work with Python 3.x. But I also know that Sage comes with its own version of Python. So can I upgrade my system's Python and let Sage use it's own Python 2.x? Will this happen automatically?


A side note: The barriers to using Python 3.x in Sage, as listed on the FAQ page, are SciPy and Cython, however recent versions of both now seem to support 3.x:

2016-10-03 15:46:17 -0500 received badge  Famous Question (source)
2016-09-30 15:44:12 -0500 answered a question Is it possible to embed a plot (or png) within another plot?

I'm not aware of a Sage command for this, but I have three ideas for how to do it:

  • Use matplotlib: Sage does a lot of its plotting under the hood with matplot lib. If all of the things you're drawing are produced using matplot lib internally, then you could try to get the underlying matplotlib objects and combine them using its (extensive) functionality. [You could check the source code to see whether there are some internal methods to get the matplot lib objects.]

  • Use PIL: Sage includes the Python Image Library, so you could try to use it to overlay the different images.

  • Use ImageMagick (convert): This isn't included with Sage, but is standard on many *nix systems. Save the individual images, and then make a montage.

2016-09-26 14:36:11 -0500 answered a question RuntimeError: Use ** for exponentiation, not '^', which means xor in Python, and has the wrong precedence.

As the error message says, python uses the double star for exponentiation, as in 2**3 = 8. Sage mostly hides this from the user, but you seem to have something executing in python that is not pre-parsed by Sage.

When I try to copy/paste your code, I get errors that N, u1, u2, c1, c2 are not defined. What values are you using for those? When I tried giving those some integer values, your code ran without error.

sage: N = 11
sage: u1 = 3
sage: u2 = 7
sage: c1 = 1
sage: c2 = -1
sage: x = PolynomialRing(ZZ.quo(N*ZZ), 'x').gen()
sage: e = 3
sage: f = (u1*x + u1*u1)^e - c1
sage: g = (u2*x + u2*u2)^e - c2
sage: f*g
10*x^6 + 3*x^5 + 9*x^3 + 3*x^2 + 9*x + 10
2016-09-21 10:05:04 -0500 received badge  Necromancer (source)
2016-09-19 15:32:29 -0500 received badge  Great Answer (source)
2016-09-19 15:32:29 -0500 received badge  Guru (source)
2016-09-19 10:53:16 -0500 answered a question Add a 3d graphics object to a tachyon scene

This has been requested from time to time in the past. Functionality to do this automatically is definitely something we'd like to add to sage. There is an open ticket, and there you can see a few different approaches that people have given in the past. Hopefully one of them will help you with your task!

https://trac.sagemath.org/ticket/14428

Unfortunately, there isn't any active work on choosing a method and including it into sage. Any effort would be welcome :)

2016-08-06 03:04:42 -0500 received badge  Famous Question (source)
2016-07-27 14:41:23 -0500 received badge  Good Answer (source)
2016-07-20 20:53:15 -0500 received badge  Notable Question (source)
2016-06-03 00:11:26 -0500 received badge  Notable Question (source)
2016-03-20 17:36:17 -0500 received badge  Notable Question (source)
2016-03-07 06:47:47 -0500 received badge  Good Answer (source)
2016-02-23 05:15:27 -0500 received badge  Great Answer (source)
2016-01-25 13:23:58 -0500 received badge  Notable Question (source)
2016-01-04 05:33:37 -0500 received badge  Notable Question (source)
2015-12-01 05:24:57 -0500 received badge  Nice Answer (source)
2015-11-16 14:19:46 -0500 commented question Boundaries for parametric_plot3d?

The camera position is set internally (I forget where at the moment -- it's not obvious at first glance). I've looked into this before, and recall finding no convenient way to override the automatic defaults. So a zero-opacity bounding object(s) is probably the most elegant solution :/

2015-10-28 21:55:14 -0500 received badge  Good Question (source)
2015-10-28 21:55:13 -0500 marked best answer Penrose tilings with Sage

I would like to make a poster from a Penrose tiling. Google didn't give me any Sage code for doing this, but I wonder if someone here knows of such a thing!

2015-10-28 21:54:28 -0500 received badge  Popular Question (source)
2015-09-30 16:56:03 -0500 received badge  Nice Answer (source)
2015-09-23 15:21:15 -0500 answered a question MainMenu.nib permissions for installer only

chmod

755 /Applications/Sage-6.8.app/Contents/Resources/English.lproj/*nib

2015-09-23 14:29:35 -0500 answered a question MainMenu.nib permissions for installer only

asdfasdfasdfasdfasdfasdf

2015-09-23 14:05:10 -0500 commented question MainMenu.nib permissions for installer only

test comment

2015-09-23 14:03:52 -0500 edited question MainMenu.nib permissions for installer only
Sage: Unable to read contents in the Interface Builder file at path /Applications/Sage-6.8.app/Contents/Resources/English.lproj/MainMenu.nib due to error: The file “MainMenu.nib” couldn’t be opened because you don’t have permission to view it..

bash-3.2# ls -ld /Applications/Sage-6.8.app/Contents/Resources/English.lproj
drwxr-xr-x@ 6 installer  admin  204 Sep 22 13:22 /Applications/Sage-6.8.app/Contents/Resources/English.lproj

bash-3.2# ls -l /Applications/Sage-6.8.app/Contents/Resources/English.lproj
total 16
-rw-r--r--@ 1 installer  admin  410 Jul 28 16:45 Credits.html
-rw-r--r--@ 1 installer  admin   92 Jul 28 16:45 InfoPlist.strings
drwx------@ 4 installer  admin  136 Feb 14  2014 MainMenu.nib
drwx------@ 4 installer  admin  136 Feb 14  2014 MyDocument.nib

Also had the same problem with 6.5 10.10 app.