Skip to content

Commit

Permalink
Trac #20109: Add pictures to plot3d.py
Browse files Browse the repository at this point in the history
Patch to add pictures generated using .. PLOT:: to the plot3d.py file

URL: http://trac.sagemath.org/20109
Reported by: jhonrubia6
Ticket author(s): Javier Honrubia Gonzalez
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager authored and vbraun committed Apr 25, 2016
2 parents 97f1af7 + 2962cd9 commit 2f431d2
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/sage/plot/plot3d/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ cdef class Graphics3d(SageObject):
a_max[i] = a_max[i] + 1
return a_min, a_max


def bounding_box(self):
"""
Return the lower and upper corners of a 3d bounding box for ``self``.
Expand Down Expand Up @@ -1735,6 +1734,20 @@ end_scene""" % (render_params.antialiasing,
string_list += ['</volume></mesh></object></amf>']
return "".join(string_list)

def plot(self):
"""
Draw a 3D plot of this graphics object, which just returns this
object since this is already a 3D graphics object.
Needed to support PLOT in doctrings, see :trac:`17498`
EXAMPLES::
sage: S = sphere((0,0,0), 2)
sage: S.plot() is S
True
"""
return self

# if you add any default parameters you must update some code below
SHOW_DEFAULTS = {'viewer': 'jmol',
Expand Down
15 changes: 14 additions & 1 deletion src/sage/plot/plot3d/parametric_surface.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ cdef class ParametricSurface(IndexFaceSet):

self.render_grid = urange, vrange


def get_grid(self, ds):
"""
TEST::
Expand Down Expand Up @@ -673,6 +672,20 @@ cdef class ParametricSurface(IndexFaceSet):
"""
raise NotImplementedError

def plot(self):
"""
Draw a 3D plot of this graphics object, which just returns this
object since this is already a 3D graphics object.
Needed to support PLOT in doctrings, see :trac:`17498`
EXAMPLES::
sage: S = parametric_plot3d( (sin, cos, lambda u: u/10), (0, 20))
sage: S.plot() is S
True
"""
return self

class MoebiusStrip(ParametricSurface):
"""
Expand Down
Loading

0 comments on commit 2f431d2

Please sign in to comment.