Ask Your Question

pangard's profile - activity

2011-01-02 13:28:09 +0100 received badge  Nice Answer (source)
2011-01-02 05:05:53 +0100 received badge  Necromancer (source)
2011-01-02 04:07:31 +0100 answered a question What features should we add to this site?

A protocol for including a question and answer by the same person.

This site is a much better reference than the sage-support group. The questions are edited and refined and misguided answers move down the list (but remain there, just in case), and the search works (take that, google). So how about this becomes the place to share some tips with other users? But should we expose all the tip in the question or split it in two parts? And what should be done with the karma?

2010-12-31 03:32:18 +0100 answered a question tubeplot3d function in sage ?

Well, you sure can't use that script, that's not python. The tubular neighborhood of radius R can be plotted easily with a parametric_surface3d plot, if you can write its parametric equations. Parametric equations for a tubular neighborhood require a Frenet frame for the curve which might be problematic, but you seem to know about that. I don't know of anyone who has worked the equations already, although there is some people working in diff geometry in Sage right now, so I might be wrong. Doens't seem too hard, anyway, does it?

Alternatively, if you can find the implicit equations for the tubular neighborhood, you can use implicit_plot3d (though I don't see how this can be done in some generality).

2010-12-24 12:09:00 +0100 commented answer Compiling R with PNG support

could you be more specific? I apt-get installed xorg-dev and libpng12-dev, then "sage -f"'ed the package r-2...spkg, but then I had no png and no X11 capabilities. (running sage from a ssh console here: were you inside an X11 session?)

2010-12-17 16:29:21 +0100 received badge  Teacher (source)
2010-12-17 04:42:19 +0100 commented answer How to make 1:1 matrix plots?

I opened the image with gimp, and cut away the numbers: it's roughly 450x225, and yes, some pixels are square in the vertical direction, other pixels are square in the horizontal direction. I think the rectangular pixels have to do with rescaling without antialias. But: do we want antialias for a matrix_plot? You can also try pylab.imshow, maybe this one uses antialias. (BTW, did you mean 506px × 266px?)

2010-12-16 16:15:48 +0100 received badge  Editor (source)
2010-12-16 16:13:48 +0100 answered a question How to make 1:1 matrix plots?

Your matrix is not square, and the result looks just fine to me. With aspect_ratio=1, all pixels are square, so a 50x100 matrix becomes a 250x500 image. If you want a square picture, you have to compress in the x direction:

matrix_plot(random_matrix(ZZ,50,100)).show(aspect_ratio=2)
2010-12-16 16:07:24 +0100 answered a question fractional power to negative number

You can also try to play around with simplify_trig and simplify_radical:

sage: eq = (-2)^(1/3) == - 2^(1/3)
sage: bool(eq.simplify_radical())
True

sage: eq = cos(x)*(tan(x))^(1/3) == (sin(x)*(cos(x))^2)^(1/3)
sage: print eq.simplify_trig().simplify_radical()
sage: bool(eq.simplify_trig().simplify_radical())
True
2010-12-16 10:12:16 +0100 received badge  Supporter (source)
2010-12-16 10:11:44 +0100 commented question Can I define a function from a list of values?

Could you be more specific? Are the points uniformly spaced? Do you need to interpolate the values of the function? If you use floats for indices in, say, a dictionary, rounding errors will cause trouble, so I don't see how you could use non-integer indices...