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.Sat, 11 Jul 2020 15:05:32 +0200Spline interpolation varies hugely when variables are rescaled in 3d-lists ?https://ask.sagemath.org/question/52429/spline-interpolation-varies-hugely-when-variables-are-rescaled-in-3d-lists/Dear all,
Here is a short script:
----------
(nbx, nby) = (74, 90)
def fx(x):
return (0.5 + x/2.5)
def fy(y):
return (40*y)
zetaPlot = list_plot3d([(30 * (fx(x/nbx)-1/2)+1/2 , fy(y/nby), 5 * abs(zeta(fx(x/nbx) + I*fy(y/nby))))
for x in range(-nbx, nbx+1) for y in range(-nby, nby+1)],
interpolation_type = 'spline')
zetaPlot.show()
----------
Now modify the z-coordinate: replace "5 * abs(zeta...)" by "abs(zeta...)"
The resulting graph is essentially flat. Can anyone tell me what is happening there?
Also, I would like to get rid of my scaling parameters 30 and 5 by using frame_aspect_ratio, to get cleaner code and a better annoted frame, but I don't seem to understand how to do it.
A great many thanks for anyone who would take the time to teach me that, it is some hours that I'm struggling with some docs and examples without having reached much --
Best, OlivierOlivier R.Sat, 11 Jul 2020 15:05:32 +0200https://ask.sagemath.org/question/52429/How does list_plot3d interpret nxn matrices?https://ask.sagemath.org/question/42091/how-does-list_plot3d-interpret-nxn-matrices/ From the [documentation](http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/list_plot3d.html) of `list_plot3d`
>INPUT:
>v - something that defines a set of points in 3 space, for example:
> - a matrix
> - a list of 3-tuples
> - a list of lists (all of the same length) - this is treated the same as a matrix.
Intuitively I would guess that the function would only accept $3 \times n$ matrices and/or their transposes, but the first example on the document page is a plot of a five by five matrix
n = 5
m = matrix(RDF, n, [(i+j)%n for i in [1..n] for j in [1..n]])
p = list_plot3d(m)
p
**Question**: How does `list_plot3d` interpret this $5 \times 5$ matrix as a set of points in 3-space?
One might suspect that `list_plot3d` handles matrices the same was as, for example, `point3d` but this is not the case. For example, the points visualized by `point3d` do not lie on the surface given by `list_plot3d` in the above example as witnessed by
p + point3d(m, size=33)
amdallWed, 18 Apr 2018 20:34:16 +0200https://ask.sagemath.org/question/42091/Correct input for list_plot3d(..., interpolation='spline')https://ask.sagemath.org/question/42020/correct-input-for-list_plot3d-interpolationspline/I'm trying to construct smooth surfaces from lists of points in 3-space using `list_plot3d` and the `spline` option, but without success. For example, the input
> list_plot3d ([(-1, 2, 3), (2, -1, 3), (3, -1, 2), (-1 ,3 ,2), (2, 3, -1), (3, 2, -1)], interpolation_type='spline')
returns the error
>TypeError: m >= (kx+1)(ky+1) must hold
The following returns the expected piecewise linear surface suggesting that there is a special restriction on the input when using the `spline` option.
> list_plot3d ([(-1, 2, 3), (2, -1, 3), (3, -1, 2), (-1 ,3 ,2), (2, 3, -1), (3, 2, -1)])
**Question**: What is the correct input to obtain a best fit polynomial surface going through the six points in $\mathbb{R}^3$?
**Edit**: As pointed out by @slelievre, since these six points lie in a common plane, the corresponding surface should be the plane containing the points. So why does `Sage` throw an error instead of this plane?amdallSun, 15 Apr 2018 20:05:24 +0200https://ask.sagemath.org/question/42020/Plot in 3D without interpolationhttps://ask.sagemath.org/question/9187/plot-in-3d-without-interpolation/Can I use list_plot3d without interpolation, or is there some equivalent? I just want to plot the output of a numerical integration (specifically, the Lorenz attractor) and the interpolation is **not** helpful.jaiaMon, 30 Jul 2012 04:02:06 +0200https://ask.sagemath.org/question/9187/