#11258: Add documentation for plotting max and min functions
-------------------------------+--------------------------
Reporter: kcrisman | Owner: jason, was
Type: enhancement | Status: new
Priority: major | Milestone:
Component: graphics | Resolution:
Keywords: beginner | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------+--------------------------
Old description:
> The function `min` and `max` are Python builtins. The name of the
> corresponding symbolic functions are `min_symbolic` and `max_symbolic
> that were implemented in #6949:
> {{{
> sage: f(x) = min_symbolic(cos(x), sin(x))
> sage: f
> x |--> min(cos(x), sin(x))
> }}}
>
> It would be nice to have examples involving them in the function
> `sage.plot.plot.plot`. Those can be
> {{{
> sage: f(x) = min_symbolic(cos(x), sin(x))
> sage: f
> x |--> min(cos(x), sin(x))
> sage: plot(f, (x,-2*pi,2*pi))
> }}}
> or/and
> {{{
> sage: f1(p) = 2*p + 1
> sage: f2(p) = -p + 3
> sage: f3(p) = 4*p - 1
> sage: f4(p) = 3/2*p
> sage: P = plot([f1,f2,f3,f4], (p,0,2), linestyle='--')
> sage: P += plot(max_symbolic(f1(p), f2(p), f3(p), f4(p)), (p,0,2),
> color='red')
> sage: P += plot(min_symbolic(f1(p), f2(p), f3(p), f4(p)), (p,0,2),
> color='green')
> sage: P.show()
> }}}
>
> But be careful that the following currently does not work
> {{{
> sage: symbolic_min(f1, f2)
> Traceback (most recent call last):
> ...
> TypeError: ...
> }}}
New description:
The function `min` and `max` are Python builtins. The name of the
corresponding symbolic functions are `min_symbolic` and `max_symbolic`
that were implemented in #6949:
{{{
sage: f(x) = min_symbolic(cos(x), sin(x))
sage: f
x |--> min(cos(x), sin(x))
}}}
It would be nice to have examples involving them in the function
`sage.plot.plot.plot`. Those can be
{{{
sage: f(x) = min_symbolic(cos(x), sin(x))
sage: f
x |--> min(cos(x), sin(x))
sage: plot(f, (x,-2*pi,2*pi))
}}}
or/and
{{{
sage: f1(p) = 2*p + 1
sage: f2(p) = -p + 3
sage: f3(p) = 4*p - 1
sage: f4(p) = 3/2*p
sage: P = plot([f1,f2,f3,f4], (p,0,2), linestyle='--')
sage: P += plot(max_symbolic(f1(p), f2(p), f3(p), f4(p)), (p,0,2),
color='red')
sage: P += plot(min_symbolic(f1(p), f2(p), f3(p), f4(p)), (p,0,2),
color='green')
sage: P.show()
}}}
But be careful that the following currently does not work
{{{
sage: symbolic_min(f1, f2)
Traceback (most recent call last):
...
TypeError: ...
}}}
--
Comment (by kcrisman):
Seems okay, though I haven't tested this in three years, as you can see :)
--
Ticket URL: <http://trac.sagemath.org/ticket/11258#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.