code stringlengths 17 6.64M |
|---|
@options(base=10)
def plot_semilogx(funcs, *args, **kwds):
"\n Plot graphics in 'semilogx' scale, that is, the horizontal axis will be\n in logarithmic scale.\n\n INPUT:\n\n - ``base`` -- (default: `10`); the base of the logarithm. This must be\n greater than 1.\n\n - ``funcs`` -- any Sage obj... |
@options(base=10)
def plot_semilogy(funcs, *args, **kwds):
"\n Plot graphics in 'semilogy' scale, that is, the vertical axis will be\n in logarithmic scale.\n\n INPUT:\n\n - ``base`` -- (default: `10`); the base of the logarithm. This must be\n greater than 1.\n\n - ``funcs`` -- any Sage objec... |
@options(base=10)
def list_plot_loglog(data, plotjoined=False, **kwds):
"\n Plot the ``data`` in 'loglog' scale, that is, both the horizontal and the\n vertical axes will be in logarithmic scale.\n\n INPUT:\n\n - ``base`` -- (default: `10`); the base of the logarithm. This must be\n greater than ... |
@options(base=10)
def list_plot_semilogx(data, plotjoined=False, **kwds):
"\n Plot ``data`` in 'semilogx' scale, that is, the horizontal axis will be\n in logarithmic scale.\n\n INPUT:\n\n - ``base`` -- (default: `10`); the base of the logarithm. This must be\n greater than 1.\n\n For all othe... |
@options(base=10)
def list_plot_semilogy(data, plotjoined=False, **kwds):
"\n Plot ``data`` in 'semilogy' scale, that is, the vertical axis will be\n in logarithmic scale.\n\n INPUT:\n\n - ``base`` -- (default: `10`); the base of the logarithm. This must be\n greater than 1.\n\n For all other ... |
def to_float_list(v):
'\n Given a list or tuple or iterable v, coerce each element of v to a\n float and make a list out of the result.\n\n EXAMPLES::\n\n sage: from sage.plot.plot import to_float_list\n sage: to_float_list([1,1/2,3])\n [1.0, 0.5, 3.0]\n '
return [float(x) for... |
def reshape(v, n, m):
'\n Helper function for creating graphics arrays.\n\n The input array is flattened and turned into an `n\times m`\n array, with blank graphics object padded at the end, if\n necessary.\n\n INPUT:\n\n - ``v`` -- a list of lists or tuples\n\n - ``n, m`` -- integers\n\n ... |
def graphics_array(array, nrows=None, ncols=None):
"\n Plot a list of lists (or tuples) of graphics objects on one canvas,\n arranged as an array.\n\n INPUT:\n\n - ``array`` -- either a list of lists of\n :class:`~sage.plot.graphics.Graphics` elements or a\n single list of :class:`~sage.plot... |
def multi_graphics(graphics_list):
'\n Plot a list of graphics at specified positions on a single canvas.\n\n If the graphics positions define a regular array, use\n :func:`graphics_array` instead.\n\n INPUT:\n\n - ``graphics_list`` -- a list of graphics along with their\n positions on the can... |
def minmax_data(xdata, ydata, dict=False):
"\n Return the minimums and maximums of ``xdata`` and ``ydata``.\n\n If dict is False, then minmax_data returns the tuple (xmin, xmax,\n ymin, ymax); otherwise, it returns a dictionary whose keys are\n 'xmin', 'xmax', 'ymin', and 'ymax' and whose values are t... |
def adaptive_refinement(f, p1, p2, adaptive_tolerance=0.01, adaptive_recursion=5, level=0, *, excluded=False):
"\n The adaptive refinement algorithm for plotting a function ``f``. See\n the docstring for plot for a description of the algorithm.\n\n INPUT:\n\n - ``f`` -- a function of one variable\n\n ... |
def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize=True, initial_points=None, *, excluded=False, imaginary_tolerance=1e-08):
"\n Calculate plot points for a function f in the interval xrange. The\n adaptive refinement algorithm is also automatically ... |
def implicit_plot3d(f, xrange, yrange, zrange, **kwds):
'\n Plot an isosurface of a function.\n\n INPUT:\n\n - ``f`` -- function\n\n - ``xrange`` -- a 2-tuple (x_min, x_max) or a 3-tuple (x, x_min, x_max)\n\n - ``yrange`` -- a 2-tuple (y_min, y_max) or a 3-tuple (y, y_min, y_max)\n\n - ``zra... |
def list_plot3d(v, interpolation_type='default', point_list=None, **kwds):
"\n A 3-dimensional plot of a surface defined by the list `v`\n of points in 3-dimensional space.\n\n INPUT:\n\n - ``v`` - something that defines a set of points in 3 space:\n\n - a matrix\n\n - a list of 3-tuples\n\n... |
def list_plot3d_matrix(m, **kwds):
"\n A 3-dimensional plot of a surface defined by a matrix ``M``\n defining points in 3-dimensional space.\n\n See :func:`list_plot3d` for full details.\n\n INPUT:\n\n - ``M`` -- a matrix\n\n OPTIONAL KEYWORDS:\n\n - ``**kwds`` - all other arguments are passe... |
def list_plot3d_array_of_arrays(v, interpolation_type, **kwds):
"\n A 3-dimensional plot of a surface defined by a list of lists ``v``\n defining points in 3-dimensional space.\n\n This is done by making the list of lists into a matrix and passing\n back to :func:`list_plot3d`. See :func:`list_plot3d... |
def list_plot3d_tuples(v, interpolation_type, **kwds):
"\n A 3-dimensional plot of a surface defined by the list `v`\n of points in 3-dimensional space.\n\n INPUT:\n\n - ``v`` -- something that defines a set of points in 3\n space, for example:\n\n - a matrix\n\n This will be if using... |
@rename_keyword(alpha='opacity')
def parametric_plot3d(f, urange, vrange=None, plot_points='automatic', boundary_style=None, **kwds):
'\n Return a parametric three-dimensional space curve or surface.\n\n There are four ways to call this function:\n\n - ``parametric_plot3d([f_x, f_y, f_z], (u_min, u_max))... |
def _parametric_plot3d_curve(f, urange, plot_points, **kwds):
'\n Return a parametric three-dimensional space curve.\n This function is used internally by the\n :func:`parametric_plot3d` command.\n\n There are two ways this function is invoked by\n :func:`parametric_plot3d`.\n\n - ``parametric_p... |
def _parametric_plot3d_surface(f, urange, vrange, plot_points, boundary_style, **kwds):
'\n Return a parametric three-dimensional space surface.\n This function is used internally by the\n :func:`parametric_plot3d` command.\n\n There are two ways this function is invoked by\n :func:`parametric_plot... |
def index_face_set(face_list, point_list, enclosed, **kwds):
"\n Helper function that creates ``IndexFaceSet`` object for the\n tetrahedron, dodecahedron, and icosahedron.\n\n INPUT:\n\n - ``face_list`` -- list of faces, given explicitly from the\n solid invocation\n\n - ``point_list`` -- list... |
def prep(G, center, size, kwds):
"\n Helper function that scales and translates the platonic\n solid, and passes extra keywords on.\n\n INPUT:\n\n - ``center`` -- 3-tuple indicating the center (default passed\n from :func:`index_face_set` is the origin `(0,0,0)`)\n\n - ``size`` -- number indic... |
@rename_keyword(alpha='opacity')
def tetrahedron(center=(0, 0, 0), size=1, **kwds):
'\n A 3d tetrahedron.\n\n INPUT:\n\n - ``center`` -- (default: (0,0,0))\n\n - ``size`` -- (default: 1)\n\n - ``color`` -- a string (``"red"``, ``"green"``, etc)\n or a tuple (r, g, b) with r, g, b numbers betwe... |
@rename_keyword(alpha='opacity')
def cube(center=(0, 0, 0), size=1, color=None, frame_thickness=0, frame_color=None, **kwds):
'\n A 3D cube centered at the origin with default side lengths 1.\n\n INPUT:\n\n - ``center`` -- (default: (0,0,0))\n\n - ``size`` -- (default: 1) the side lengths of the\n ... |
@rename_keyword(alpha='opacity')
def octahedron(center=(0, 0, 0), size=1, **kwds):
"\n Return an octahedron.\n\n INPUT:\n\n - ``center`` -- (default: (0,0,0))\n\n - ``size`` -- (default: 1)\n\n - ``color`` -- a string that describes a color; this\n can also be a list of 3-tuples or strings len... |
@rename_keyword(alpha='opacity')
def dodecahedron(center=(0, 0, 0), size=1, **kwds):
"\n A dodecahedron.\n\n INPUT:\n\n - ``center`` -- (default: (0,0,0))\n\n - ``size`` -- (default: 1)\n\n - ``color`` -- a string that describes a color; this\n can also be a list of 3-tuples or strings length ... |
@rename_keyword(alpha='opacity')
def icosahedron(center=(0, 0, 0), size=1, **kwds):
"\n An icosahedron.\n\n INPUT:\n\n - ``center`` -- (default: (0, 0, 0))\n\n - ``size`` -- (default: 1)\n\n - ``color`` -- a string that describes a color; this\n can also be a list of 3-tuples or strings length... |
class _Coordinates():
'\n This abstract class encapsulates a new coordinate system for plotting.\n Sub-classes must implement the :meth:`transform` method which, given\n symbolic variables to use, generates a 3-tuple of functions in terms of\n those variables that can be used to find the Cartesian (X,... |
def _find_arguments_for_callable(func):
"\n Find the names of arguments (that do not have default values) for\n a callable function, taking care of several special cases in Sage.\n\n If the parameters cannot be found, then return ``[]``.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.plot3d imp... |
class _ArbitraryCoordinates(_Coordinates):
'\n An arbitrary coordinate system.\n '
_name = 'Arbitrary Coordinates'
def __init__(self, custom_trans, dep_var, indep_vars):
"\n Initialize an arbitrary coordinate system.\n\n INPUT:\n\n - ``custom_trans`` - A 3-tuple of tra... |
class Spherical(_Coordinates):
"\n A spherical coordinate system for use with ``plot3d(transformation=...)``\n where the position of a point is specified by three numbers:\n\n - the *radial distance* (``radius``) from the origin\n\n - the *azimuth angle* (``azimuth``) from the positive `x`-axis\n\n ... |
class SphericalElevation(_Coordinates):
"\n A spherical coordinate system for use with ``plot3d(transformation=...)``\n where the position of a point is specified by three numbers:\n\n - the *radial distance* (``radius``) from the origin\n\n - the *azimuth angle* (``azimuth``) from the positive `x`-ax... |
class Cylindrical(_Coordinates):
"\n A cylindrical coordinate system for use with ``plot3d(transformation=...)``\n where the position of a point is specified by three numbers:\n\n - the *radial distance* (``radius``) from the `z`-axis\n\n - the *azimuth angle* (``azimuth``) from the positive `x`-axis\... |
class TrivialTriangleFactory():
'\n Class emulating behavior of :class:`~sage.plot.plot3d.tri_plot.TriangleFactory`\n but simply returning a list of vertices for both regular and\n smooth triangles.\n '
def triangle(self, a, b, c, color=None):
'\n Function emulating behavior of\n ... |
def plot3d(f, urange, vrange, adaptive=False, transformation=None, **kwds):
'\n Plots a function in 3d.\n\n INPUT:\n\n - ``f`` -- a symbolic expression or function of 2\n variables\n\n - ``urange`` -- a 2-tuple (u_min, u_max) or a 3-tuple\n (u, u_min, u_max)\n\n - ``vrange`` -- a 2-t... |
def plot3d_adaptive(f, x_range, y_range, color='automatic', grad_f=None, max_bend=0.5, max_depth=5, initial_depth=4, num_colors=128, **kwds):
'\n Adaptive 3d plotting of a function of two variables.\n\n This is used internally by the plot3d command when the option\n ``adaptive=True`` is given.\n\n INP... |
def spherical_plot3d(f, urange, vrange, **kwds):
"\n Plots a function in spherical coordinates. This function is\n equivalent to::\n\n sage: r,u,v=var('r,u,v')\n sage: f=u*v; urange=(u,0,pi); vrange=(v,0,pi)\n sage: T = (r*cos(u)*sin(v), r*sin(u)*sin(v), r*cos(v), [u,v])\n sage:... |
def cylindrical_plot3d(f, urange, vrange, **kwds):
"\n Plots a function in cylindrical coordinates. This function is\n equivalent to::\n\n sage: r, u, v = var('r,u,v')\n sage: f = u*v; urange = (u, 0, pi); vrange = (v, 0, pi)\n sage: T = (r*cos(u), r*sin(u), v, [u, v])\n sage: p... |
def axes(scale=1, radius=None, **kwds):
"\n Creates basic axes in three dimensions. Each axis is a three\n dimensional arrow object.\n\n INPUT:\n\n - ``scale`` -- (default: 1) the length of the axes (all three will be the\n same)\n\n - ``radius`` -- (default: .01) the radius of the axes as ar... |
def plot_vector_field3d(functions, xrange, yrange, zrange, plot_points=5, colors='jet', center_arrows=False, **kwds):
"\n Plot a 3d vector field\n\n INPUT:\n\n - ``functions`` -- a list of three functions, representing the x-,\n y-, and z-coordinates of a vector\n\n - ``xrange``, ``yrange``, and ... |
@rename_keyword(alpha='opacity')
def revolution_plot3d(curve, trange, phirange=None, parallel_axis='z', axis=(0, 0), print_vector=False, show_curve=False, **kwds):
"\n Return a plot of a revolved curve.\n\n There are three ways to call this function:\n\n - ``revolution_plot3d(f,trange)`` where `f` is a f... |
@rename_keyword(alpha='opacity')
def line3d(points, thickness=1, radius=None, arrow_head=False, **kwds):
'\n Draw a 3d line joining a sequence of points.\n\n One may specify either a thickness or radius. If a thickness is\n specified, this line will have a constant diameter regardless of\n scaling and... |
@rename_keyword(alpha='opacity')
@options(opacity=1, color='blue', aspect_ratio=[1, 1, 1], thickness=2)
def bezier3d(path, **options):
'\n Draw a 3-dimensional bezier path.\n\n Input is similar to bezier_path, but each point in the path and\n each control point is required to have 3 coordinates.\n\n I... |
@rename_keyword(alpha='opacity')
@options(opacity=1, color=(0, 0, 1))
def polygon3d(points, **options):
'\n Draw a polygon in 3d.\n\n INPUT:\n\n - ``points`` -- the vertices of the polygon\n\n Type ``polygon3d.options`` for a dictionary of the default\n options for polygons. You can change this to... |
@rename_keyword(alpha='opacity')
@options(opacity=1, color=(0, 0, 1))
def polygons3d(faces, points, **options):
"\n Draw the union of several polygons in 3d.\n\n Useful to plot a polyhedron as just one :class:`IndexFaceSet`.\n\n INPUT:\n\n - ``faces`` -- list of faces, every face given by the list\n ... |
def frame3d(lower_left, upper_right, **kwds):
"\n Draw a frame in 3-D.\n\n Primarily used as a helper function for creating frames for 3-D\n graphics viewing.\n\n INPUT:\n\n - ``lower_left`` -- the lower left corner of the frame, as a\n list, tuple, or vector.\n\n - ``upper_right`` -- the u... |
def frame_labels(lower_left, upper_right, label_lower_left, label_upper_right, eps=1, **kwds):
'\n Draw correct labels for a given frame in 3-D.\n\n Primarily used as a helper function for creating frames for 3-D\n graphics viewing - do not use directly unless you know what you\n are doing!\n\n INP... |
def ruler(start, end, ticks=4, sub_ticks=4, absolute=False, snap=False, **kwds):
"\n Draw a ruler in 3-D, with major and minor ticks.\n\n INPUT:\n\n - ``start`` -- the beginning of the ruler, as a list,\n tuple, or vector.\n\n - ``end`` -- the end of the ruler, as a list, tuple,\n or vector.... |
def ruler_frame(lower_left, upper_right, ticks=4, sub_ticks=4, **kwds):
"\n Draw a frame made of 3-D rulers, with major and minor ticks.\n\n INPUT:\n\n - ``lower_left`` -- the lower left corner of the frame, as a\n list, tuple, or vector.\n\n - ``upper_right`` -- the upper right corner of the fra... |
@rename_keyword(alpha='opacity')
def sphere(center=(0, 0, 0), size=1, **kwds):
"\n Return a plot of a sphere of radius ``size`` centered at\n `(x,y,z)`.\n\n INPUT:\n\n - `(x,y,z)` -- center (default: (0,0,0))\n\n - ``size`` -- the radius (default: 1)\n\n EXAMPLES: A simple sphere::\n\n ... |
def text3d(txt, x_y_z, **kwds):
'\n Display 3d text.\n\n INPUT:\n\n - ``txt`` -- some text\n\n - ``(x,y,z)`` -- position tuple `(x,y,z)`\n\n - ``**kwds`` -- standard 3d graphics options\n\n EXAMPLES:\n\n We write the word Sage in red at position (1,2,3)::\n\n sage: text3d("Sage", (1... |
class Point(PrimitiveObject):
"\n Create a position in 3-space, represented by a sphere of fixed\n size.\n\n INPUT:\n\n - ``center`` -- point (3-tuple)\n\n - ``size`` -- (default: 1)\n\n EXAMPLES:\n\n We normally access this via the ``point3d`` function. Note that extra\n keywords are c... |
class Line(PrimitiveObject):
"\n Draw a 3d line joining a sequence of points.\n\n This line has a fixed diameter unaffected by transformations and\n zooming. It may be smoothed if ``corner_cutoff < 1``.\n\n INPUT:\n\n - ``points`` -- list of points to pass through\n\n - ``thickness`` -- (optiona... |
@rename_keyword(alpha='opacity')
def point3d(v, size=5, **kwds):
'\n Plot a point or list of points in 3d space.\n\n INPUT:\n\n - ``v`` -- a point or list of points\n\n - ``size`` -- (default: 5) size of the point (or\n points)\n\n - ``color`` -- a string (``"red"``, ``"green"`` etc)\n ... |
class Tachyon(WithEqualityById, SageObject):
"\n Create a scene the can be rendered using the Tachyon ray tracer.\n\n INPUT:\n\n - ``xres`` -- (default 350)\n - ``yres`` -- (default 350)\n - ``zoom`` -- (default 1.0)\n - ``antialiasing`` -- (default ``False``)\n - ``aspectratio`` -- (default... |
class Light():
'\n Represent lighting objects.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import Light\n sage: q = Light((1,1,1), 1, (1,1,1))\n sage: q._center\n (1.0, 1.0, 1.0)\n '
def __init__(self, center, radius, color):
'\n Store the center... |
class Texfunc():
def __init__(self, ttype=0, center=(0, 0, 0), rotate=(0, 0, 0), scale=(1, 1, 1), imagefile=''):
'\n Create a texture function.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import Texfunc\n sage: t = Texfunc()\n sage: t._ttype\n ... |
class Texture():
def __init__(self, name, ambient=0.2, diffuse=0.8, specular=0.0, opacity=1.0, color=(1.0, 0.0, 0.5), texfunc=0, phong=0, phongsize=0, phongtype='PLASTIC', imagefile=''):
"\n Store texture information.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import ... |
class Sphere():
'\n A class for creating spheres in tachyon.\n '
def __init__(self, center, radius, texture):
"\n Store the center, radius, and texture information in a class.\n\n EXAMPLES::\n\n sage: t = Tachyon()\n sage: from sage.plot.plot3d.tachyon import... |
class Ring():
'\n An annulus of zero thickness.\n '
def __init__(self, center, normal, inner, outer, texture):
"\n Create a ring with the given center, normal, inner radius,\n outer radius, and texture.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon impor... |
class FractalLandscape():
'\n Axis-aligned fractal landscape.\n\n Does not seem very useful at the moment, but perhaps will be improved in the future.\n '
def __init__(self, res, scale, center, texture):
"\n Create a fractal landscape in tachyon.\n\n EXAMPLES::\n\n s... |
class Cylinder():
'\n An infinite cylinder.\n '
def __init__(self, center, axis, radius, texture):
"\n Create a cylinder with the given parameters.\n\n EXAMPLES::\n\n sage: t = Tachyon()\n sage: from sage.plot.plot3d.tachyon import Cylinder\n sage:... |
class Plane():
'\n An infinite plane.\n '
def __init__(self, center, normal, texture):
"\n Create the plane object.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import Plane\n sage: p = Plane((1,2,3), (1,2,4), 's')\n sage: p.str()\n ... |
class FCylinder():
'\n A finite cylinder.\n '
def __init__(self, base, apex, radius, texture):
"\n Create a finite cylinder object.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import FCylinder\n sage: fc = FCylinder((0,0,0),(1,1,1),.1,'s')\n ... |
class Axis_aligned_box():
'\n Box with axis-aligned edges with the given min and max coordinates.\n '
def __init__(self, min_p, max_p, texture):
"\n Create the axis-aligned box object.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import Axis_aligned_box\n ... |
class TachyonTriangle(Triangle):
'\n Basic triangle class.\n '
def str(self):
"\n Return the scene string for a triangle.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import TachyonTriangle\n sage: t = TachyonTriangle([-1,-1,-1],[0,0,0],[1,2,3])\n ... |
class TachyonSmoothTriangle(SmoothTriangle):
'\n A triangle along with a normal vector, which is used for smoothing.\n '
def str(self):
"\n Return the scene string for a smoothed triangle.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import TachyonSmoothTriang... |
class TachyonTriangleFactory(TriangleFactory):
'\n A class to produce triangles of various rendering types.\n '
def __init__(self, tach, tex):
"\n Initialize with tachyon instance and texture.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import TachyonTriangle... |
class ParametricPlot():
'\n Parametric plotting routines.\n '
def str(self):
"\n Return the tachyon string representation of the parameterized curve.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import ParametricPlot\n sage: f = lambda t: (t,t^2,t^3... |
def tostr(s, length=3, out_type=float):
"\n Convert vector information to a space-separated string.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.tachyon import tostr\n sage: tostr((1,1,1))\n ' 1.0 1.0 1.0 '\n sage: tostr('2 3 2')\n '2 3 2'\n "
if isinstance(s, str... |
def _new_global_texture_id():
"\n Generate a new unique id for a texture.\n\n EXAMPLES::\n\n sage: sage.plot.plot3d.texture._new_global_texture_id()\n 'texture...'\n sage: sage.plot.plot3d.texture._new_global_texture_id()\n 'texture...'\n "
global uniq_c
uniq_c += 1
... |
def is_Texture(x):
'\n Deprecated. Use ``isinstance(x, Texture)`` instead.\n\n EXAMPLES::\n\n sage: from sage.plot.plot3d.texture import is_Texture, Texture\n sage: t = Texture(0.5)\n sage: is_Texture(t)\n doctest:...: DeprecationWarning: Please use isinstance(x, Texture)\n ... |
def parse_color(info, base=None):
"\n Parse the color.\n\n It transforms a valid color string into a color object and\n a color object into an RBG tuple of length 3. Otherwise,\n it multiplies the info by the base color.\n\n INPUT:\n\n - ``info`` - color, valid color str or number\n - ``base`... |
class Texture(WithEqualityById, SageObject, metaclass=ClasscallMetaclass):
'\n Class representing a texture.\n\n See documentation of :meth:`Texture.__classcall__\n <sage.plot.plot3d.texture.Texture.__classcall__>` for more details and\n examples.\n\n EXAMPLES:\n\n We create a translucent textur... |
class Triangle():
'\n A graphical triangle class.\n '
def __init__(self, a, b, c, color=0):
'\n a, b, c : triples (x,y,z) representing corners on a triangle in 3-space.\n\n TESTS::\n\n sage: from sage.plot.plot3d.tri_plot import Triangle\n sage: tri = Triangl... |
class SmoothTriangle(Triangle):
'\n A class for smoothed triangles.\n '
def __init__(self, a, b, c, da, db, dc, color=0):
'\n a, b, c : triples (x,y,z) representing corners on a triangle in 3-space\n da, db, dc : triples (dx,dy,dz) representing the normal vector at each point a,b,... |
class TriangleFactory():
def triangle(self, a, b, c, color=None):
'\n Parameters:\n a, b, c : triples (x,y,z) representing corners on a triangle in 3-space\n\n Returns:\n a Triangle object with the specified coordinates\n\n TESTS::\n\n sage: from sage.plot.pl... |
class TrianglePlot():
'\n Recursively plots a function of two variables by building squares of 4 triangles, checking at\n every stage whether or not each square should be split into four more squares. This way,\n more planar areas get fewer triangles, and areas with higher curvature get more triangles.\... |
def crossunit(u, v):
"\n This function computes triangle normal unit vectors by taking the\n cross-products of the midpoint-to-corner vectors. It always goes\n around clockwise so we're guaranteed to have a positive value near\n 1 when neighboring triangles are parallel. However -- crossunit\n do... |
class PlotBlock():
'\n A container class to hold information about spatial blocks.\n '
def __init__(self, left, left_c, top, top_c, right, right_c, bottom, bottom_c):
'\n\n TESTS::\n\n sage: from sage.plot.plot3d.tri_plot import PlotBlock\n sage: pb = PlotBlock([0,0... |
class PlotField(GraphicPrimitive):
'\n Primitive class that initializes the\n PlotField graphics type\n '
def __init__(self, xpos_array, ypos_array, xvec_array, yvec_array, options):
"\n Create the graphics primitive PlotField. This sets options\n and the array to be plotted a... |
@options(plot_points=20, frame=True)
def plot_vector_field(f_g, xrange, yrange, **options):
"\n ``plot_vector_field`` takes two functions of two variables xvar and yvar\n (for instance, if the variables are `x` and `y`, take `(f(x,y), g(x,y))`)\n and plots vector arrows of the function over the specified... |
def plot_slope_field(f, xrange, yrange, **kwds):
"\n ``plot_slope_field`` takes a function of two variables xvar and yvar\n (for instance, if the variables are `x` and `y`, take `f(x,y)`), and at\n representative points `(x_i,y_i)` between xmin, xmax, and ymin, ymax\n respectively, plots a line with s... |
class Point(GraphicPrimitive_xydata):
"\n Primitive class for the point graphics type. See point?, point2d?\n or point3d? for information about actually plotting points.\n\n INPUT:\n\n - ``xdata`` -- list of x values for points in Point object\n\n - ``ydata`` -- list of y values for points in Poin... |
def point(points, **kwds):
'\n Return either a 2-dimensional or 3-dimensional point or sum of points.\n\n INPUT:\n\n - ``points`` - either a single point (as a tuple), a list of\n points, a single complex number, or a list of complex numbers.\n\n For information regarding additional arguments, ... |
@rename_keyword(color='rgbcolor', pointsize='size')
@options(alpha=1, aspect_ratio='automatic', faceted=False, legend_color=None, legend_label=None, marker='o', markeredgecolor=None, rgbcolor=(0, 0, 1), size=10)
def point2d(points, **options):
'\n A point of size ``size`` defined by point = `(x, y)`.\n\n IN... |
class Polygon(GraphicPrimitive_xydata):
'\n Primitive class for the Polygon graphics type. For information\n on actual plotting, please see :func:`polygon`, :func:`polygon2d`,\n or :func:`~sage.plot.plot3d.shapes2.polygon3d`.\n\n INPUT:\n\n - ``xdata`` -- list of `x`-coordinates of points defining... |
def polygon(points, **options):
'\n Return either a 2-dimensional or 3-dimensional polygon depending\n on value of points.\n\n For information regarding additional arguments, see either\n :func:`polygon2d` or :func:`~sage.plot.plot3d.shapes2.polygon3d`.\n Options may be found and set using the dict... |
@rename_keyword(color='rgbcolor')
@options(alpha=1, rgbcolor=(0, 0, 1), edgecolor=None, thickness=None, legend_label=None, legend_color=None, aspect_ratio=1.0, fill=True)
def polygon2d(points, **options):
'\n Return a 2-dimensional polygon defined by ``points``.\n\n Type ``polygon2d.options`` for a dictiona... |
class GraphicPrimitive(WithEqualityById, SageObject):
"\n Base class for graphics primitives, e.g., things that knows how to draw\n themselves in 2D.\n\n EXAMPLES:\n\n We create an object that derives from GraphicPrimitive::\n\n sage: P = line([(-1,-2), (3,5)])\n sage: P[0]\n Line... |
class GraphicPrimitive_xydata(GraphicPrimitive):
def get_minmax_data(self):
"\n Returns a dictionary with the bounding box data.\n\n EXAMPLES::\n\n sage: d = polygon([[1,2], [5,6], [5,0]], rgbcolor=(1,0,1))[0].get_minmax_data()\n sage: d['ymin']\n 0.0\n ... |
def plot_step_function(v, vertical_lines=True, **kwds):
'\n Return the line graphics object that gives the plot of the step\n function `f` defined by the list `v` of pairs `(a,b)`. Here if\n `(a,b)` is in `v`, then `f(a) = b`. The user does not have to\n worry about sorting the input list `v`.\n\n ... |
class StreamlinePlot(GraphicPrimitive):
'\n Primitive class that initializes the StreamlinePlot graphics type\n '
def __init__(self, xpos_array, ypos_array, xvec_array, yvec_array, options):
"\n Create the graphics primitive StreamlinePlot. This sets options\n and the array to be ... |
@options(plot_points=20, density=1.0, frame=True)
def streamline_plot(f_g, xrange, yrange, **options):
"\n Return a streamline plot in a vector field.\n\n ``streamline_plot`` can take either one or two functions. Consider\n two variables `x` and `y`.\n\n If given two functions `(f(x,y), g(x,y))`, then... |
class Text(GraphicPrimitive):
'\n Base class for Text graphics primitive.\n\n TESTS:\n\n We test creating some text::\n\n sage: text("I like Fibonacci",(3,5))\n Graphics object consisting of 1 graphics primitive\n\n .. PLOT::\n\n sphinx_plot(text("I like Fibonacci",(3,5)))\n\n ... |
@rename_keyword(color='rgbcolor')
@options(fontsize=10, rgbcolor=(0, 0, 1), horizontal_alignment='center', vertical_alignment='center', axis_coords=False, clip=False)
def text(string, xy, **options):
'\n Return a 2D text graphics object at the point `(x, y)`.\n\n Type ``text.options`` for a dictionary of op... |
def is_ProbabilitySpace(S):
return isinstance(S, ProbabilitySpace_generic)
|
def is_DiscreteProbabilitySpace(S):
return isinstance(S, DiscreteProbabilitySpace)
|
def is_RandomVariable(X):
return isinstance(X, RandomVariable_generic)
|
def is_DiscreteRandomVariable(X):
return isinstance(X, DiscreteRandomVariable)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.