#12962: Implement multi-function plotting options in plot()
-------------------------------------+-------------------------------------
Reporter: alauve | Owner: was
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.8
Component: user interface | Resolution:
Keywords: plot, linestyle, | Merged in:
color | Reviewers:
Authors: Aaron Lauve | Work issues:
Report Upstream: N/A | Commit:
Branch: | c9b1aa481c1a817899603255d05be7ad1aaadf36
u/alauve/implement_multi_function_plotting_options_in_plot__| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Aaron Lauve', 'oldvalue': u'Johan S. R. Nielsen'}):
* cc: saliola (added)
* author: Johan S. R. Nielsen => Aaron Lauve
Old description:
> The code `plot([x,x^2],-.2,2)` is a nice shortcut for plotting both x and
> x!^ 2 on the same graph. However, if you want to choose different colors
> or linestyles for each function, then it seems you have to execute, e.g.,
>
> {{{
> p1=plot(x,-.2,1.2,color='blue',linestyle='dotted');
> p2=plot(x^2,-.2,1.2,color='red',linestyle='dashed');
> p1+p2
> }}}
> Here is how Maple and Mathematica handle this issue, respectively:
>
> It seems that the keyword 'fill' allows for a dictionary input, so
> perhaps the relevant code there could serve as a template?
>
> {{{
> [> plot([x, x^2], x= -.2..1.2, color=["blue", "red"],linestyle=[dot,
> longdash]);
>
> In[1]:= Plot[{x, x^2}, {x, -.2, 1.2}, PlotStyle -> {{Blue, Dotted}, {Red,
> Dashed}}]
> }}}
New description:
The code `plot([x,x^2],-.2,2)` is a nice shortcut for plotting both x and
x!^ 2 on the same graph. However, if you want to choose different colors
or linestyles for each function, then it seems you have to execute, e.g.,
{{{
p1=plot(x,-.2,1.2,color='blue',linestyle='dotted');
p2=plot(x^2,-.2,1.2,color='red',linestyle='dashed');
p1+p2
}}}
Here is how Maple and Mathematica handle this issue, respectively:
It seems that the keyword 'fill' allows for a dictionary input, so perhaps
the relevant code there could serve as a template?
{{{
[> plot([x, x^2], x= -.2..1.2, color=["blue", "red"],linestyle=[dot,
longdash]);
In[1]:= Plot[{x, x^2}, {x, -.2, 1.2}, PlotStyle -> {{Blue, Dotted}, {Red,
Dashed}}]
}}}
''Remarks:''
1. distinct choices for the curves should be made automatically for the
user. Running, e.g.,
{{{
In[1]:= Plot[{x, x^2}, {x, -.2, 1.2}]
}}}
in Mathematica produces two curves that are not both solid-blue.
2. the functionality for ``fillcolor``, ``color``, and ``fill`` should be
the same insofar as possible.
--
Comment:
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=f93aaf3543acd63a6783b5275cf6b5889c4d3080
f93aaf3]||{{{Merge branch 'develop' into
t/12962/implement_multi_function_plotting_options_in_plot__}}}||
||[http://git.sagemath.org/sage.git/commit/?id=c9b1aa481c1a817899603255d05be7ad1aaadf36
c9b1aa4]||{{{fixed a typo}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/12962#comment:13>
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.