Ask Your Question

niles's profile - activity

2023-10-21 12:57:28 +0200 received badge  Notable Question (source)
2022-12-31 10:16:23 +0200 received badge  Good Answer (source)
2022-03-26 15:34:00 +0200 received badge  Good Answer (source)
2021-11-24 15:33:32 +0200 received badge  Popular Question (source)
2021-11-24 15:33:32 +0200 received badge  Notable Question (source)
2021-07-29 21:17:31 +0200 received badge  Popular Question (source)
2021-04-03 08:26:57 +0200 received badge  Nice Answer (source)
2021-03-13 14:21:33 +0200 received badge  Nice Answer (source)
2020-07-16 05:17:01 +0200 received badge  Nice Answer (source)
2020-07-01 12:42:03 +0200 received badge  Famous Question (source)
2019-05-06 01:32:04 +0200 received badge  Nice Answer (source)
2018-06-07 16:50:33 +0200 received badge  Nice Answer (source)
2018-04-11 18:32:08 +0200 received badge  Nice Answer (source)
2017-12-22 10:44:15 +0200 received badge  Good Answer (source)
2017-12-22 10:44:15 +0200 received badge  Nice Answer (source)
2017-10-27 04:58:55 +0200 received badge  Popular Question (source)
2017-10-27 04:58:55 +0200 received badge  Notable Question (source)
2017-06-16 19:43:32 +0200 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 22:09:16 +0200 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 23:00:52 +0200 received badge  Famous Question (source)
2017-03-24 10:26:21 +0200 received badge  Great Answer (source)
2017-02-23 03:18:13 +0200 received badge  Famous Question (source)
2017-02-22 05:58:54 +0200 received badge  Good Answer (source)
2017-02-08 23:32:44 +0200 received badge  Great Answer (source)
2016-12-04 05:32:11 +0200 received badge  Good Answer (source)
2016-11-05 11:37:53 +0200 received badge  Necromancer (source)
2016-11-05 11:37:26 +0200 received badge  Nice Answer (source)
2016-11-05 11:36:57 +0200 received badge  Nice Answer (source)
2016-11-03 03:37:36 +0200 received badge  Necromancer (source)
2016-11-03 02:57:24 +0200 received badge  Nice Answer (source)
2016-11-02 22:23:26 +0200 received badge  Necromancer (source)
2016-11-02 21:52:03 +0200 received badge  Nice Answer (source)
2016-11-02 21:52:03 +0200 received badge  Good Answer (source)
2016-10-17 20:31:27 +0200 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 22:46:17 +0200 received badge  Famous Question (source)
2016-09-30 22:44:12 +0200 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 21:36:11 +0200 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 17:05:04 +0200 received badge  Necromancer (source)
2016-09-19 22:32:29 +0200 received badge  Guru (source)
2016-09-19 22:32:29 +0200 received badge  Great Answer (source)
2016-09-19 17:53:16 +0200 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 10:05:03 +0200 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!

2016-08-06 10:04:42 +0200 received badge  Famous Question (source)
2016-07-27 21:41:23 +0200 received badge  Good Answer (source)
2016-07-21 03:53:15 +0200 received badge  Notable Question (source)
2016-06-03 07:11:26 +0200 received badge  Notable Question (source)