#12962: Implement multi-function plotting options in plot()
-------------------------------------+-------------------------------------
       Reporter:  alauve             |        Owner:  was
           Type:  enhancement        |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-7.3
      Component:  user interface     |   Resolution:
       Keywords:  plot, linestyle,   |    Merged in:
  color                              |
        Authors:  Aaron Lauve        |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/graphs/multi_function_plot_options-12962|  
eb224ab0fa489d2444d179a4d78574559b52ec97
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by tscrim):

 * cc: jhonrubia6, paulmasson (added)
 * commit:  f7394a8a3d15dd4734a2bb13cdcae2b750641136 =>
     eb224ab0fa489d2444d179a4d78574559b52ec97
 * branch:  u/alauve/implement_multi_function_plotting_options_in_plot__ =>
     public/graphs/multi_function_plot_options-12962
 * milestone:  sage-6.8 => sage-7.3


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}}]
> }}}
>
> ''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.

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:

 Just rebased the current branch, but it would be good to have this
 functionality.
 ----
 New commits:
 
||[https://git.sagemath.org/sage.git/commit?id=eb224ab0fa489d2444d179a4d78574559b52ec97
 eb224ab]||{{{Merge branch
 'u/alauve/implement_multi_function_plotting_options_in_plot__' of
 trac.sagemath.org:sage into
 public/graphs/multi_function_plot_options-12962}}}||

--
Ticket URL: <https://trac.sagemath.org/ticket/12962#comment:20>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to