#12962: Implement multi-function plotting options in plot()
------------------------------------------+------------------------
       Reporter:  alauve                  |        Owner:  was
           Type:  enhancement             |       Status:  new
       Priority:  minor                   |    Milestone:  sage-6.8
      Component:  user interface          |   Resolution:
       Keywords:  plot, linestyle, color  |    Merged in:
        Authors:  Johan S. R. Nielsen     |    Reviewers:
Report Upstream:  N/A                     |  Work issues:
         Branch:                          |       Commit:
   Dependencies:                          |     Stopgaps:
------------------------------------------+------------------------
Changes (by alauve):

 * cc: kcrisman, ppurka (added)
 * milestone:  sage-6.4 => sage-6.8


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:
>
> `[> 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}}]
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/12962#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.

Reply via email to