Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## matplotlib-users

 [Matplotlib-users] Is it possible to plot axes with arrows ? From: Francois Maltey - 2011-02-02 15:10:45 ```Hello, I use matplolib by the mathematical system Sage in order to plot a function. The Sage code calls matplotlib and uses its options : The Sage command is plot (sin, x, -5, 5) I add labels par axes_labels or remove axes by : plot (sin(x), x, -5, 5, axes_label = ['x', 'y']) plot (sin(x), x, -5, 5, axes=false) French users (and maybe others) uses arrows and not lines for axes. I'm looking for a plot (sin(x), x, -5, 5, axes="arrows") Is there a pretty way to get these arrows. The result of this code isn't so fine. length, width and color don't match. plot (sin(x), x, -5, 5, axes=false) + arrow ((-5,0),(5,0)) + arrow ((0,-1),(0,1)) What options do you propose ? I don't find relevant answers in the archive. F. from France. ```
 Re: [Matplotlib-users] Is it possible to plot axes with arrows ? From: Paul Ivanov - 2011-02-04 02:23:33 Attachments: Message as HTML     Message as HTML
 Re: [Matplotlib-users] Is it possible to plot axes with arrows ? From: Jason Grout - 2011-02-04 04:16:14 ```On 2/2/11 8:51 AM, Francois Maltey wrote: > Hello, > > I use matplolib by the mathematical system Sage in order to plot a function. > The Sage code calls matplotlib and uses its options : The Sage command is > > plot (sin, x, -5, 5) > > I add labels par axes_labels or remove axes by : > > plot (sin(x), x, -5, 5, axes_label = ['x', 'y']) > plot (sin(x), x, -5, 5, axes=false) > > French users (and maybe others) uses arrows and not lines for axes. > I'm looking for a plot (sin(x), x, -5, 5, axes="arrows") > Is there a pretty way to get these arrows. The result of this code isn't > so fine. > length, width and color don't match. > > plot (sin(x), x, -5, 5, axes=false) + arrow ((-5,0),(5,0)) + arrow > ((0,-1),(0,1)) > > What options do you propose ? I've made a Sage ticket for this: http://trac.sagemath.org/sage_trac/ticket/10740 As a clumsy workaround, you could use the .matplotlib() method for Sage graphics objects to get the matplotlib figure object for the graphics object. Then you could: 1. figure out which spine was being used as the drawn axes 2. use that spine's transform to place an arrow at the end of the spine (using the example code that was just posted in another message to draw the arrow). 3. Draw the figure Thanks, Jason ```