turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS/GRAPH and ODS Graphics
- /
- Multi-directional arrows on a graph

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-10-2016 09:09 AM

Hello :-),

I need to replicate the following image below using SAS 9.4, and I was wondering if there were any easier ways to plot the directional arrows? I have thought about using the vector statement because with that I can specify the start and end of the line, and draw the arrow (in the middle) which will be in the right direction, but I was wondering if I could use any other methods please?

Thank you in advance for your help.

Kriss

Accepted Solutions

Solution

05-11-2016
04:47 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to djrisks

05-10-2016 09:33 AM

I think your approach is the best. If you want to draw the vector from (x1, y1) to (x2, y2), define the midpoint as

m = ( (x1+x2)/2, (y1+y2)/2 ). Then

1. Draw vector from m to (x2, y2). Use the NOARROWHEADS option to suppress the arrow head.

2. In a separate VECTOR statement, draw vector from (x1, y1) to m. Put an arrow head at the end (this is the default).

3. Use the SCATTER statement to overlay the dots at (x1, y1) and (x2, y2).

All Replies

Solution

05-11-2016
04:47 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to djrisks

05-10-2016 09:33 AM

I think your approach is the best. If you want to draw the vector from (x1, y1) to (x2, y2), define the midpoint as

m = ( (x1+x2)/2, (y1+y2)/2 ). Then

1. Draw vector from m to (x2, y2). Use the NOARROWHEADS option to suppress the arrow head.

2. In a separate VECTOR statement, draw vector from (x1, y1) to m. Put an arrow head at the end (this is the default).

3. Use the SCATTER statement to overlay the dots at (x1, y1) and (x2, y2).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

05-10-2016 09:40 AM

Great! Thank you for this Rick! :-)