try using 'dashed' instead of '--'. Works for me. I have no idea why '--' works for plotting lines but not vectors (which are arrows) ...
Rado On Aug 3, 3:46 pm, cesarnda <[email protected]> wrote: > what is wrong with the following: > > sage: v1 = vector([1,2]) > sage: v2 = vector([2,1]) > sage: p1 = plot(v1, rgbcolor=(1,0,0)) > sage: p2 = plot(v2, rgbcolor=(0,1,0)) > sage: t1 = text("V1", (1,2.1), rgbcolor=(1,0,0)) > sage: t2 = text("V2", (2,1.1), rgbcolor=(0,1,0)) > sage: p3 = plot(v1 + v2, rgbcolor=(0,0,1)) > sage: t3 = text("V1 + V2", v1+v2 + vector([0,0.1]), rgbcolor=(0,0,1)) > sage: p4 = plot(vector([3,3]), rgbcolor=(1,1,1), linestyle='--') > sage: show(p1 + p2 + p3 + p4 + t1 + t2 + t3, xmin=-0.5, xmax=3.5, > ymin=-0.5, ymax=3.5) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/Users/cesarnda/.sage/sage_notebook/worksheets/admin/9/code/ > 120.py", line 7, in <module> > show(p1 + p2 + p3 + p4 + t1 + t2 + t3, xmin=-_sage_const_0p5 , > xmax=_sage_const_3p5 , ymin=-_sage_const_0p5 , ymax=_sage_const_3p5 ) > File "", line 1, in <module> > > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/sage/misc/functional.py", line 952, in show > return x.show(*args, **kwds) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/sage/plot/plot.py", line 1302, in show > hgridlinesstyle=hgridlinesstyle) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/sage/plot/plot.py", line 1627, in save > canvas.print_figure(filename, dpi=dpi) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/backend_bases.py", line 1453, in print_figure > **kwargs) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/backends/backend_agg.py", line 326, in print_png > FigureCanvasAgg.draw(self) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/backends/backend_agg.py", line 282, in draw > self.figure.draw(self.renderer) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/figure.py", line 773, in draw > for a in self.axes: a.draw(renderer) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/axes.py", line 1668, in draw > a.draw(renderer) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/patches.py", line 3588, in draw > gc.set_linestyle(self._linestyle) > File "/Users/cesarnda/Software/sage/local/lib/python2.6/site- > packages/matplotlib/backend_bases.py", line 650, in set_linestyle > raise ValueError('Unrecognized linestyle: %s' % style) > ValueError: Unrecognized linestyle: -- > > Why does it say that the linestyle='--' is not recognized? --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
