Thanks for the helpful suggestions. I am not sure who wrote the plotting funtion, but it goes back to the early days of Sage. I have a feeling that David Roe most recently worked on it, and if so then we might be able to fix it at the upcoming LMFDB workshop when he, and Nicolas and I will be there.
John On 16 June 2015 at 13:30, kcrisman <[email protected]> wrote: > This is indeed odd. > >> >> X=plot([]) > > > You shouldn't have to do this - let us know if it doesn't plot otherwise. > And the canonical way to do it if you really wanted to is X = Graphics() . > >> >> X+=E.base_extend(S[0]).plot(color="red",legend_label=str(exp(1.))) >> X >> >> the legend appears twice (tried with 6.4.1, 6.6, 6.7). Is it a bug ? > > > I would think so. > > sage: F = E.base_extend(S[0]) > sage: F.plot(legend_label='b') > Launched png viewer for Graphics object consisting of 2 graphics primitives > > So note that it really is two objects. > > sage: F.plot() > Launched png viewer for Graphics object consisting of 2 graphics primitives > > And it is even without the label! That just makes it obvious. In fact, > this is even documented (!) > > sage: E = EllipticCurve('37a') > sage: plot(E) > Graphics object consisting of 2 graphics primitives > > So the question is what to do about it with things like legends. The code > for plotting is very ugly, presumably to take care of the 'bounded' and > 'unbounded' components, but I did find where it comes in. > > for j in range(len(I)): > <snip> > if shape == 'o': > g += plot.line(v + list(reversed(w)) + [v[0]], **args) > elif shape == '<': > g += plot.line(list(reversed(v)) + w, **args) > elif shape == '>': > g += plot.line(v + list(reversed(w)), **args) > else: > g += plot.line(v, **args) > g += plot.line(w, **args) > return g > > So *each* component gets all optional arguments. Which ordinarily makes > sense (things like color or F.plot(marker='^') or F.plot(linestyle='--')) > but in this case does not. > > I've opened http://trac.sagemath.org/ticket/18711 but I would appreciate if > any number theorists could comment there what they expect and so forth, > because one wouldn't want some nasty side effects from anything done. One > could monkey in a solution for legend stuff but in truth there are a lot of > legend options and so it would be better to have a cleaner solution, such as > one that did the plots first and *then* passed in keyword arguments, if that > were possible. > > - kcrisman > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" 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-support. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-support" 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-support. For more options, visit https://groups.google.com/d/optout.
