code
stringlengths
17
6.64M
class LPAbstractDictionary(SageObject): '\n Abstract base class for dictionaries for LP problems.\n\n Instantiating this class directly is meaningless, see :class:`LPDictionary`\n and :class:`LPRevisedDictionary` for useful extensions.\n ' def __init__(self): '\n Initialize interna...
class LPDictionary(LPAbstractDictionary): '\n Construct a dictionary for an LP problem.\n\n A dictionary consists of the following data:\n\n .. MATH::\n\n \\begin{array}{|l|}\n \\hline\n x_B = b - A x_N\\\\\n \\hline\n z = z^* + c x_N\\\\\n \\hline\n \\end...
class LPRevisedDictionary(LPAbstractDictionary): '\n Construct a revised dictionary for an LP problem.\n\n INPUT:\n\n - ``problem`` -- an :class:`LP problem in standard form\n <InteractiveLPProblemStandardForm>`\n\n - ``basic_variables`` -- a list of basic variables or their indices\n\n OUTPUT...
class Superincreasing(SageObject): '\n A class for super-increasing sequences.\n\n Let `L = (a_1, a_2, a_3, \\dots, a_n)` be a non-empty sequence of\n non-negative integers. Then `L` is said to be super-increasing if\n each `a_i` is strictly greater than the sum of all previous values.\n That is, f...
def knapsack(seq, binary=True, max=1, value_only=False, solver=None, verbose=0, *, integrality_tolerance=0.001): "\n Solves the knapsack problem\n\n For more information on the knapsack problem, see the documentation of the\n :mod:`knapsack module <sage.numerical.knapsack>` or the\n :wikipedia:`Knapsa...
def is_LinearTensor(x): "\n Test whether ``x`` is a tensor product of linear functions with a\n free module.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n Boolean.\n\n EXAMPLES::\n\n sage: p = MixedIntegerLinearProgram()\n sage: x = p.new_variable(nonnegative=False)\n ...
@cached_function def LinearTensorParent(free_module_parent, linear_functions_parent): '\n Return the parent for the tensor product over the common ``base_ring``.\n\n The output is cached, so only a single parent is ever constructed\n for a given base ring.\n\n INPUT:\n\n - ``free_module_parent`` --...
class LinearTensorParent_class(Parent): "\n The parent for all linear functions over a fixed base ring.\n\n .. warning::\n\n You should use :func:`LinearTensorParent` to construct\n instances of this class.\n\n INPUT/OUTPUT:\n\n See :func:`LinearTensorParent`\n\n EXAMPLES::\n\n ...
def is_LinearTensorConstraint(x): "\n Test whether ``x`` is a constraint on module-valued linear functions.\n\n INPUT:\n\n - ``x`` -- anything.\n\n OUTPUT:\n\n Boolean.\n\n EXAMPLES::\n\n sage: mip.<x> = MixedIntegerLinearProgram()\n sage: vector_ieq = (x[0] * vector([1,2]) <= x[1]...
@cached_function def LinearTensorConstraintsParent(linear_functions_parent): '\n Return the parent for linear functions over ``base_ring``.\n\n The output is cached, so only a single parent is ever constructed\n for a given base ring.\n\n INPUT:\n\n - ``linear_functions_parent`` -- a\n :class:...
class LinearTensorConstraint(Element): '\n Formal constraint involving two module-valued linear functions.\n\n .. NOTE::\n\n In the code, we use "linear tensor" as abbreviation for the\n tensor product (over the common base ring) of a :mod:`linear\n function <sage.numerical.linear_funct...
class LinearTensorConstraintsParent_class(Parent): "\n Parent for :class:`LinearTensorConstraint`\n\n .. warning::\n\n This class has no reason to be instantiated by the user, and\n is meant to be used by instances of\n :class:`MixedIntegerLinearProgram`. Also, use the\n :func:`L...
def normalize_input(a): '\n Convert ``a`` to a pair ``(args, kwds)`` using some rules:\n\n - if already of that form, leave that way.\n - if ``a`` is a tuple make ``(a,{})``\n - if ``a`` is a dict make ``(tuple(),a)``\n - otherwise make ``((a,),{})``\n\n INPUT:\n\n - ``a`` -- object\n\n OU...
class Parallel(): '\n Create a ``parallel``-decorated function.\n This is the object created by :func:`parallel`.\n ' def __init__(self, p_iter='fork', ncpus=None, **kwds): '\n EXAMPLES::\n\n sage: P = sage.parallel.decorate.Parallel(); P\n <sage.parallel.decorat...
@instancedoc class ParallelFunction(): '\n Class which parallelizes a function or class method.\n This is typically accessed indirectly through\n :meth:`Parallel.__call__`.\n ' def __init__(self, parallel, func): '\n .. note::\n\n This is typically accessed indirectly th...
def parallel(p_iter='fork', ncpus=None, **kwds): '\n This is a decorator that gives a function a parallel interface,\n allowing it to be called with a list of inputs, whose values will\n be computed in parallel.\n\n .. warning::\n\n The parallel subprocesses will not have access to data\n ...
class Fork(): '\n A ``fork`` decorator class.\n ' def __init__(self, timeout=0, verbose=False): '\n INPUT:\n\n - ``timeout`` -- (default: 0) kill the subprocess after it has run this\n many seconds (wall time), or if ``timeout`` is zero, do not kill it.\n - ``verbo...
def fork(f=None, timeout=0, verbose=False): '\n Decorate a function so that when called it runs in a forked subprocess.\n\n This means that it will not have any in-memory side effects on the\n parent Sage process. The pexpect interfaces are all reset.\n\n INPUT:\n\n - ``f`` -- a function\n - ``t...
def proc_number(max_proc=None): '\n Return the number of processes to use.\n\n INPUT:\n\n - ``max_proc`` -- an upper bound on the number of processes or\n ``None``.\n\n EXAMPLES::\n\n sage: from sage.parallel.map_reduce import proc_number\n sage: proc_number() # random\n 8\n...
class AbortError(Exception): '\n Exception for aborting parallel computations.\n\n This is used both as exception or as abort message.\n\n TESTS::\n\n sage: from sage.parallel.map_reduce import AbortError\n sage: raise AbortError\n Traceback (most recent call last):\n ...\n ...
class ActiveTaskCounterDarwin(): "\n Handling the number of active tasks.\n\n A class for handling the number of active tasks in a distributed\n computation process. This is essentially a semaphore, but Darwin OSes\n do not correctly implement POSIX's semaphore semantic. So we use\n a shared intege...
class ActiveTaskCounterPosix(): "\n Handling the number of active tasks.\n\n A class for handling the number of active tasks in a distributed\n computation process. This is the standard implementation on POSIX\n compliant OSes. We essentially wrap a semaphore.\n\n .. note::\n\n A legitimate ...
class RESetMapReduce(): "\n Map-Reduce on recursively enumerated sets.\n\n INPUT:\n\n Description of the set:\n\n - either ``forest=f`` -- where ``f`` is a :class:`RecursivelyEnumeratedSet_forest>`\n\n - or a triple ``roots, children, post_process`` as follows\n\n - ``roots=r`` -- The root of ...
class RESetMapReduceWorker(mp.Process): "\n Worker for generate-map-reduce.\n\n This shouldn't be called directly, but instead created by\n :meth:`RESetMapReduce.setup_workers`.\n\n INPUT:\n\n - ``mapred`` -- the instance of :class:`RESetMapReduce` for which\n this process is working.\n\n -...
class RESetMPExample(RESetMapReduce): '\n An example of map reduce class.\n\n INPUT:\n\n - ``maxl`` -- the maximum size of permutations generated (default to `9`).\n\n This computes the generating series of permutations counted by their size\n up to size ``maxl``.\n\n EXAMPLES::\n\n sage:...
class RESetParallelIterator(RESetMapReduce): '\n A parallel iterator for recursively enumerated sets.\n\n This demonstrates how to use :class:`RESetMapReduce` to get an iterator on\n a recursively enumerated set for which the computations are done in\n parallel.\n\n EXAMPLES::\n\n sage: from...
def pyprocessing(processes=0): '\n Return a parallel iterator using a given number of processes\n implemented using pyprocessing.\n\n INPUT:\n\n - ``processes`` -- integer (default: 0); if 0, set to the number\n of processors on the computer.\n\n OUTPUT:\n\n - a (partially evaluated) functi...
def parallel_iter(processes, f, inputs): '\n Return a parallel iterator.\n\n INPUT:\n\n - ``processes`` -- integer\n - ``f`` -- function\n - ``inputs`` -- an iterable of pairs (args, kwds)\n\n OUTPUT:\n\n - iterator over values of ``f`` at ``args,kwds`` in some random order.\n\n EXAMPLES::...
def ncpus(): '\n Detects the number of effective CPUs in the system.\n\n EXAMPLES::\n\n sage: sage.parallel.ncpus.ncpus() # random output -- depends on machine.\n 2\n ' try: n = os.environ['SAGE_NUM_THREADS'] except KeyError: pass else: return int(n) ...
class Parallelism(Singleton, SageObject): "\n Singleton class for managing the number of processes used in parallel\n computations involved in various fields.\n\n EXAMPLES:\n\n The number of processes is initialized to 1 (no parallelization) for\n each field::\n\n sage: Parallelism()\n ...
def parallel_iter(f, inputs): "\n Reference parallel iterator implementation.\n\n INPUT:\n\n - ``f`` -- a Python function that can be pickled using\n the pickle_function command.\n\n - ``inputs`` -- a list of pickleable pairs (args, kwds), where\n args is a tuple and kwds is a dictionary.\n\...
class WorkerData(): '\n Simple class which stores data about a running ``p_iter_fork``\n worker.\n\n This just stores three attributes:\n\n - ``input``: the input value used by this worker\n\n - ``starttime``: the walltime when this worker started\n\n - ``failure``: an optional message indicatin...
class p_iter_fork(): '\n A parallel iterator implemented using ``fork()``.\n\n INPUT:\n\n - ``ncpus`` -- the maximal number of simultaneous\n subprocesses to spawn\n - ``timeout`` -- (float, default: 0) wall time in seconds until\n a subprocess is automatically killed\n - ``verbose`` ...
def animate(frames, **kwds): '\n Animate a list of frames by creating a\n :class:`sage.plot.animate.Animation` object.\n\n EXAMPLES::\n\n sage: t = SR.var("t")\n sage: a = animate((cos(c*pi*t) for c in sxrange(1, 2, .2)))\n sage: a.show() # long time # optional -- Image...
class Animation(WithEqualityById, SageObject): '\n Return an animation of a sequence of plots of objects.\n\n INPUT:\n\n - ``v`` -- iterable of Sage objects. These should preferably be\n graphics objects, but if they aren\'t, then :meth:`make_image` is\n called on them.\n\n - ``xmin, xmax, y...
class APngAssembler(): '\n Builds an APNG_ (Animated PNG) from a sequence of PNG files.\n This is used by the :meth:`sage.plot.animate.Animation.apng` method.\n\n This code is quite simple; it does little more than copying chunks\n from input PNG files to the output file. There is no optimization\n ...
class Arc(GraphicPrimitive): '\n Primitive class for the Arc graphics type. See ``arc?`` for information\n about actually plotting an arc of a circle or an ellipse.\n\n INPUT:\n\n - ``x,y`` - coordinates of the center of the arc\n\n - ``r1``, ``r2`` - lengths of the two radii\n\n - ``angle`` - ...
@rename_keyword(color='rgbcolor') @options(alpha=1, thickness=1, linestyle='solid', zorder=5, rgbcolor='blue', aspect_ratio=1.0) def arc(center, r1, r2=None, angle=0.0, sector=(0.0, (2 * pi)), **options): '\n An arc (that is a portion of a circle or an ellipse)\n\n Type ``arc.options`` to see all options.\n...
class BarChart(GraphicPrimitive): "\n Graphics primitive that represents a bar chart.\n\n EXAMPLES::\n\n sage: from sage.plot.bar_chart import BarChart\n sage: g = BarChart(list(range(4)), [1,3,2,0], {}); g\n BarChart defined by a 4 datalist\n sage: type(g)\n <class 'sage....
@rename_keyword(color='rgbcolor') @options(width=0.5, rgbcolor=(0, 0, 1), legend_label=None, aspect_ratio='automatic') def bar_chart(datalist, **options): "\n A bar chart of (currently) one list of numerical data.\n Support for more data lists in progress.\n\n EXAMPLES:\n\n A bar_chart with blue bars:...
class Circle(GraphicPrimitive): "\n Primitive class for the :class:`Circle` graphics type. See ``circle?`` for information\n about actually plotting circles.\n\n INPUT:\n\n - ``x`` -- `x`-coordinate of center of Circle\n\n - ``y`` -- `y`-coordinate of center of Circle\n\n - ``r`` -- radius of C...
@rename_keyword(color='rgbcolor') @options(alpha=1, fill=False, thickness=1, edgecolor='blue', facecolor='blue', linestyle='solid', zorder=5, legend_label=None, legend_color=None, clip=True, aspect_ratio=1.0) def circle(center, radius, **options): '\n Return a circle at a point center = `(x,y)` (or `(x,y,z)` a...
def mod_one(x): '\n Reduce a number modulo 1.\n\n INPUT:\n\n - ``x`` - an instance of Integer, int, RealNumber, etc.; the\n number to reduce\n\n OUTPUT:\n\n - a float\n\n EXAMPLES::\n\n sage: from sage.plot.colors import mod_one\n sage: mod_one(1)\n 1.0\n sage: m...
def html_to_float(c): "\n Convert a HTML hex color to a Red-Green-Blue (RGB) tuple.\n\n INPUT:\n\n - ``c`` - a string; a valid HTML hex color\n\n OUTPUT:\n\n - a RGB 3-tuple of floats in the interval [0.0, 1.0]\n\n EXAMPLES::\n\n sage: from sage.plot.colors import html_to_float\n s...
def rgbcolor(c, space='rgb'): "\n Convert a color (string, tuple, list, or :class:`Color`) to a\n mod-one reduced (see :func:`mod_one`) valid Red-Green-Blue (RGB)\n tuple. The returned tuple is also a valid matplotlib RGB color.\n\n INPUT:\n\n - ``c`` - a :class:`Color` instance, string (name or H...
class Color(): def __init__(self, r='#0000ff', g=None, b=None, space='rgb'): "\n A Red-Green-Blue (RGB) color model color object. For most\n consumer-grade devices (e.g., CRTs, LCDs, and printers), as\n well as internet applications, this is a point in the sRGB\n absolute col...
class ColorsDict(dict): "\n A dict-like collection of colors, accessible via key or attribute.\n For a list of color names, evaluate::\n\n sage: sorted(colors)\n ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', ...]\n " def __init__(self): "\n Constructs a dict-like c...
def hue(h, s=1, v=1): "\n Convert a Hue-Saturation-Value (HSV) color tuple to a valid\n Red-Green-Blue (RGB) tuple. All three inputs should lie in the\n interval [0.0, 1.0]; otherwise, they are reduced modulo 1 (see\n :func:`mod_one`). In particular ``h=0`` and ``h=1`` yield red,\n with the inter...
def float_to_html(r, g, b): '\n Convert a Red-Green-Blue (RGB) color tuple to a HTML hex color.\n\n Each input value should be in the interval [0.0, 1.0]; otherwise,\n the values are first reduced modulo one (see :func:`mod_one`).\n\n INPUT:\n\n - ``r`` -- a real number; the RGB color\'s "red" inte...
def float_to_integer(r, g, b): '\n Convert a Red-Green-Blue (RGB) color tuple to an integer.\n\n Each input value should be in the interval [0.0, 1.0]; otherwise,\n the values are first reduced modulo one (see :func:`mod_one`).\n\n INPUT:\n\n - ``r`` -- a real number; the RGB color\'s "red" intensi...
def rainbow(n, format='hex'): "\n Returns a list of colors sampled at equal intervals over the\n spectrum, from Hue-Saturation-Value (HSV) coordinates (0, 1, 1) to\n (1, 1, 1). This range is red at the extremes, but it covers\n orange, yellow, green, cyan, blue, violet, and many other hues in\n be...
def get_cmap(cmap): '\n Returns a color map (actually, a matplotlib :class:`Colormap`\n object), given its name or a [mixed] list/tuple of RGB list/tuples\n and color names. For a list of map names, evaluate::\n\n sage: sorted(colormaps)\n [\'Accent\', ...]\n\n See :func:`rgbcolor` for ...
def check_color_data(cfcm): "\n Make sure that the arguments are in order (coloring function, colormap).\n\n This will allow users to use both possible orders.\n\n EXAMPLES::\n\n sage: from sage.plot.colors import check_color_data\n sage: cf = lambda x,y : (x+y) % 1\n sage: cm = colo...
class Colormaps(MutableMapping): "\n A dict-like collection of lazily-loaded matplotlib color maps.\n For a list of map names, evaluate::\n\n sage: sorted(colormaps)\n ['Accent', ...]\n " def __init__(self): '\n Constructs an empty mutable collection of color maps.\n\n ...
class ContourPlot(GraphicPrimitive): "\n Primitive class for the contour plot graphics type.\n\n See ``contour_plot?`` for help actually doing contour plots.\n\n INPUT:\n\n - ``xy_data_array`` - list of lists giving evaluated values of the function\n on the grid\n\n - ``xrange`` - tuple of 2 f...
@suboptions('colorbar', orientation='vertical', format=None, spacing='uniform') @suboptions('label', fontsize=9, colors='blue', inline=None, inline_spacing=3, fmt='%1.2f') @options(plot_points=100, fill=True, contours=None, linewidths=None, linestyles=None, labels=False, frame=True, axes=False, colorbar=False, legend...
@options(plot_points=150, contours=(0,), fill=False, cmap=['blue']) def implicit_plot(f, xrange, yrange, **options): '\n ``implicit_plot`` takes a function of two variables, `f(x, y)`\n and plots the curve `f(x,y) = 0` over the specified\n ``xrange`` and ``yrange`` as demonstrated below.\n\n ``implici...
@options(plot_points=100, incol='blue', outcol=None, bordercol=None, borderstyle=None, borderwidth=None, frame=False, axes=True, legend_label=None, aspect_ratio=1, alpha=1) def region_plot(f, xrange, yrange, **options): '\n ``region_plot`` takes a boolean function of two variables, `f(x, y)`\n and plots the...
def equify(f): "\n Return the equation rewritten as a symbolic function to give\n negative values when ``True``, positive when ``False``.\n\n EXAMPLES::\n\n sage: from sage.plot.contour_plot import equify\n sage: var('x, y')\n (x, y)\n sage: equify(x^2 < 2)\n x^2 - 2\n ...
class DensityPlot(GraphicPrimitive): "\n Primitive class for the density plot graphics type. See\n ``density_plot?`` for help actually doing density plots.\n\n INPUT:\n\n - ``xy_data_array`` - list of lists giving evaluated values of the\n function on the grid\n\n - ``xrange`` - tuple of 2 fl...
@options(plot_points=25, cmap='gray', interpolation='catrom') def density_plot(f, xrange, yrange, **options): '\n ``density_plot`` takes a function of two variables, `f(x,y)`\n and plots the height of the function over the specified\n ``xrange`` and ``yrange`` as demonstrated below.\n\n ``density_plot...
class Disk(GraphicPrimitive): "\n Primitive class for the ``Disk`` graphics type. See ``disk?`` for\n information about actually plotting a disk (the Sage term for a sector\n or wedge of a circle).\n\n INPUT:\n\n - ``point`` - coordinates of center of disk\n\n - ``r`` - radius of disk\n\n - ...
@rename_keyword(color='rgbcolor') @options(alpha=1, fill=True, rgbcolor=(0, 0, 1), thickness=0, legend_label=None, legend_color=None, aspect_ratio=1.0) def disk(point, radius, angle, **options): '\n A disk (that is, a sector or wedge of a circle) with center\n at a point = `(x,y)` (or `(x,y,z)` and parallel...
class Ellipse(GraphicPrimitive): '\n Primitive class for the ``Ellipse`` graphics type. See ``ellipse?`` for\n information about actually plotting ellipses.\n\n INPUT:\n\n - ``x,y`` - coordinates of the center of the ellipse\n\n - ``r1, r2`` - radii of the ellipse\n\n - ``angle`` - angle\n\n ...
@rename_keyword(color='rgbcolor') @options(alpha=1, fill=False, thickness=1, edgecolor='blue', facecolor='blue', linestyle='solid', zorder=5, aspect_ratio=1.0, legend_label=None, legend_color=None) def ellipse(center, r1, r2, angle=0, **options): '\n Return an ellipse centered at a point center = ``(x,y)`` wit...
def is_Graphics(x): '\n Return True if `x` is a Graphics object.\n\n EXAMPLES::\n\n sage: from sage.plot.graphics import is_Graphics\n sage: is_Graphics(1)\n False\n sage: is_Graphics(disk((0.0, 0.0), 1, (0, pi/2))) # needs sage.symbolic\n Tru...
def _parse_figsize(figsize): "\n Helper function to get a figure size in matplotlib format.\n\n INPUT:\n\n - ``figsize`` -- width or [width, height] in inches; if only the width is\n provided, the height is computed from matplotlib's default aspect ratio\n\n OUTPUT:\n\n - a pair of ``float``'s...
class Graphics(WithEqualityById, SageObject): "\n The Graphics object is an empty list of graphics objects. It is\n useful to use this object when initializing a for loop where\n different graphics object will be added to the empty object.\n\n EXAMPLES::\n\n sage: G = Graphics(); print(G)\n ...
def GraphicsArray(*args, **kwargs): '\n This is deprecated (see :trac:`28675`).\n Use :class:`sage.plot.multigraphics.GraphicsArray` instead.\n\n TESTS::\n\n sage: from sage.plot.graphics import GraphicsArray\n sage: c = circle((0,0), 1)\n sage: G = GraphicsArray([c, c])\n doc...
class Histogram(GraphicPrimitive): "\n Graphics primitive that represents a histogram. This takes\n quite a few options as well.\n\n EXAMPLES::\n\n sage: from sage.plot.histogram import Histogram\n sage: g = Histogram([1,3,2,0], {}); g\n Histogram defined by a data list of size 4\n ...
@options(aspect_ratio='automatic', align='mid', weights=None, range=None, bins=10, edgecolor='black') def histogram(datalist, **options): '\n Computes and draws the histogram for list(s) of numerical data.\n See examples for the many options; even more customization is\n available using matplotlib direct...
class HyperbolicArcCore(BezierPath): '\n Base class for Hyperbolic arcs and hyperbolic polygons in the\n hyperbolic plane.\n\n The Upper Half Model, Poincaré Disk Model, and Klein Disk model\n are supported.\n ' def _bezier_path(self, z0, z1, model, first=False): '\n Construct a...
class HyperbolicArc(HyperbolicArcCore): '\n Primitive class for hyberbolic arc type.\n\n See ``hyperbolic_arc?`` for information about plotting a hyperbolic\n arc in the complex plane.\n\n INPUT:\n\n - ``A, B`` -- end points of the hyperbolic arc\n - ``model`` -- the hyperbolic model used, which...
@rename_keyword(color='rgbcolor') @options(alpha=1, fill=False, thickness=1, rgbcolor='blue', zorder=2, linestyle='solid') def hyperbolic_arc(a, b, model='UHP', **options): '\n Plot an arc from ``a`` to ``b`` in hyperbolic plane.\n\n INPUT:\n\n - ``a, b`` - complex numbers connected by a hyperbolic arc\n...
class HyperbolicPolygon(HyperbolicArcCore): '\n Primitive class for hyperbolic polygon type.\n\n See ``hyperbolic_polygon?`` for information about plotting a hyperbolic\n polygon in the complex plane.\n\n INPUT:\n\n - ``pts`` -- coordinates of the polygon (as complex numbers)\n\n - ``options`` -...
def _winding_number(vertices, point): '\n Compute the winding number of the given point in the plane `z = 0`.\n\n TESTS::\n\n sage: from sage.plot.hyperbolic_polygon import _winding_number\n sage: _winding_number([(0,0,4),(1,0,3),(1,1,2),(0,1,1)],(0.5,0.5,10))\n 1\n sage: _windin...
@rename_keyword(color='rgbcolor') @options(alpha=1, fill=False, thickness=1, rgbcolor='blue', zorder=2, linestyle='solid') def hyperbolic_polygon(pts, model='UHP', resolution=200, **options): '\n Return a hyperbolic polygon in the hyperbolic plane with vertices ``pts``.\n\n Type ``?hyperbolic_polygon`` to s...
def hyperbolic_triangle(a, b, c, model='UHP', **options): '\n Return a hyperbolic triangle in the hyperbolic plane with\n vertices ``(a,b,c)``.\n\n Type ``?hyperbolic_polygon`` to see all options.\n\n INPUT:\n\n - ``a, b, c`` -- complex numbers in the upper half complex plane\n\n OPTIONS:\n\n ...
class HyperbolicRegularPolygon(HyperbolicPolygon): '\n Primitive class for regular hyperbolic polygon type.\n\n See ``hyperbolic_regular_polygon?`` for information about plotting\n a hyperbolic regular polygon in the upper complex halfplane.\n\n INPUT:\n\n - ``sides`` -- number of sides of the poly...
@rename_keyword(color='rgbcolor') @options(alpha=1, fill=False, thickness=1, rgbcolor='blue', zorder=2, linestyle='solid') def hyperbolic_regular_polygon(sides, i_angle, center=CC(0, 1), **options): "\n Return a hyperbolic regular polygon in the upper half model of\n Hyperbolic plane given the number of sid...
class Line(GraphicPrimitive_xydata): '\n Primitive class that initializes the line graphics type.\n\n EXAMPLES::\n\n sage: from sage.plot.line import Line\n sage: Line([1,2,7], [1,5,-1], {})\n Line defined by 3 points\n ' def __init__(self, xdata, ydata, options): "\n ...
def line(points, **kwds): '\n Returns either a 2-dimensional or 3-dimensional line depending\n on value 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 additi...
@rename_keyword(color='rgbcolor') @options(alpha=1, rgbcolor=(0, 0, 1), thickness=1, legend_label=None, legend_color=None, aspect_ratio='automatic') def line2d(points, **options): '\n Create the line through the given list of points.\n\n INPUT:\n\n - ``points`` - either a single point (as a tuple), a li...
class MatrixPlot(GraphicPrimitive): "\n Primitive class for the matrix plot graphics type. See\n ``matrix_plot?`` for help actually doing matrix plots.\n\n INPUT:\n\n - ``xy_data_array`` - list of lists giving matrix values corresponding to\n the grid\n\n - ``xrange`` - tuple of 2 floats indi...
@suboptions('colorbar', orientation='vertical', format=None) @suboptions('subdivision', boundaries=None, style=None) @options(aspect_ratio=1, axes=False, cmap='Greys', colorbar=False, frame=True, marker='.', norm=None, flip_y=True, subdivisions=False, ticks_integer=True, vmin=None, vmax=None) def matrix_plot(mat, xra...
def setup_for_eval_on_grid(funcs, ranges, plot_points=None, return_vars=False, imaginary_tolerance=1e-08): "\n Calculate the necessary parameters to construct a list of points,\n and make the functions fast_callable.\n\n INPUT:\n\n - ``funcs`` -- a function, or a list, tuple, or vector of functions\n\...
def unify_arguments(funcs): '\n Return a tuple of variables of the functions, as well as the\n number of "free" variables (i.e., variables that defined in a\n callable function).\n\n INPUT:\n\n - ``funcs`` -- a list of functions; these can be symbolic\n expressions, polynomials, etc\n\n OUT...
def _multiple_of_constant(n, pos, const): '\n Function for internal use in formatting ticks on axes with\n nice-looking multiples of various symbolic constants, such\n as `\\pi` or `e`. Should only be used via keyword argument\n `tick_formatter` in :meth:`plot.show`. See documentation\n for the m...
def get_matplotlib_linestyle(linestyle, return_type): '\n Function which translates between matplotlib linestyle in short notation\n (i.e. \'-\', \'--\', \':\', \'-.\') and long notation (i.e. \'solid\', \'dashed\',\n \'dotted\', \'dashdot\' ).\n\n If linestyle is none of these allowed options, the fu...
class FastCallablePlotWrapper(FastCallableFloatWrapper): '\n A fast-callable wrapper for plotting that returns ``nan`` instead\n of raising an error whenever the imaginary tolerance is exceeded.\n\n A detailed rationale for this can be found in the superclass\n documentation.\n\n EXAMPLES:\n\n T...
class MultiGraphics(WithEqualityById, SageObject): "\n Base class for objects composed of :class:`~sage.plot.graphics.Graphics`\n objects.\n\n Both the display and the output to a file of ``MultiGraphics`` objects\n are governed by the method :meth:`save`, which is called by the rich output\n displ...
class GraphicsArray(MultiGraphics): "\n This class implements 2-dimensional graphical objects that constitute\n an array of :class:`~sage.plot.graphics.Graphics` drawn on a single\n canvas.\n\n The user interface is through the function\n :func:`~sage.plot.plot.graphics_array`.\n\n INPUT:\n\n ...
def SelectiveFormatter(formatter, skip_values): '\n This matplotlib formatter selectively omits some tick values and\n passes the rest on to a specified formatter.\n\n EXAMPLES:\n\n This example is almost straight from a matplotlib example.\n\n ::\n\n sage: # needs numpy\n sage: from ...
def xydata_from_point_list(points): '\n Return two lists (xdata, ydata), each coerced to a list of floats,\n which correspond to the x-coordinates and the y-coordinates of the\n points.\n\n The points parameter can be a list of 2-tuples or some object that\n yields a list of one or two numbers.\n\n...
@options(alpha=1, thickness=1, fill=False, fillcolor='automatic', fillalpha=0.5, plot_points=200, adaptive_tolerance=0.01, adaptive_recursion=5, detect_poles=False, exclude=None, legend_label=None, __original_opts=True, aspect_ratio='automatic', imaginary_tolerance=1e-08) def plot(funcs, *args, **kwds): '\n Us...
def _plot(funcs, xrange, parametric=False, polar=False, fill=False, label='', randomize=True, **options): '\n Internal function which does the actual plotting.\n\n INPUT:\n\n - ``funcs`` -- function or list of functions to be plotted\n - ``xrange`` -- two or three tuple of [input variable], min and ma...
@options(aspect_ratio=1.0) def parametric_plot(funcs, *args, **kwargs): '\n Plot a parametric curve or surface in 2d or 3d.\n\n :func:`parametric_plot` takes two or three functions as a\n list or a tuple and makes a plot with the first function giving the\n `x` coordinates, the second function giving ...
@options(aspect_ratio=1.0) def polar_plot(funcs, *args, **kwds): "\n ``polar_plot`` takes a single function or a list or\n tuple of functions and plots them with polar coordinates in the given\n domain.\n\n This function is equivalent to the :func:`plot` command with the options\n ``polar=True`` an...
@options(aspect_ratio='automatic') def list_plot(data, plotjoined=False, **kwargs): "\n ``list_plot`` takes either a list of numbers, a list of tuples, a numpy\n array, or a dictionary and plots the corresponding points.\n\n If given a list of numbers (that is, not a list of tuples or lists),\n ``list...
@options(base=10) def plot_loglog(funcs, *args, **kwds): "\n Plot graphics 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 1. The base can be ...