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
- /
- connecting plot data points on GPLOT: can disconti...

- 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
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-22-2011 08:26 PM

Hello wise people who know more than me! This is my first post and I don't even know if I am using the correct SAS procedure for what I need.

I am using GPLOT in SAS 9.1.3 to make plots of the type y-variable*x-variable, and using INTERPOL=JOIN to connect data points with a line.

Is there a way to introduce discontinuity in the line? That is, join up data points for x values of A, B and C and join up data points for x values of D, E and F*without* having the line join up C and D?

I am using GPLOT in SAS 9.1.3 to make plots of the type y-variable*x-variable, and using INTERPOL=JOIN to connect data points with a line.

Is there a way to introduce discontinuity in the line? That is, join up data points for x values of A, B and C and join up data points for x values of D, E and F

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

01-23-2011 10:24 AM

Consider using OVERLAY, possibly also "subgroup", and assign unique SAS variable(s) in a DATA step to plot as needed based on your SAS input file conditions.

Scott Barry

SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

gplot subgroup overlay join data points site:sas.com

Scott Barry

SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

gplot subgroup overlay join data points site:sas.com

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

01-23-2011 11:58 AM

Hi:

In addition to Scott's suggestions, investigate the SKIPMISS option with PROC GPLOT -- for example, in the data below, the month of June has an observation, but the value for EXPENSE is missing (.) and therefore, the SKIPMISS option tells PROC GPLOT that join should "skip" over the missing value with the line. If your data does not have an observation for June (for example), then the line would be drawn from May - July -- so you might have to put a "dummy" observation into your data for SKIPMISS to work, under that scenario.

cynthia

[pre]

** Missing Y Values;

data expense;

infile datalines;

input date : mmddyy10. expense dept $;

format date monyy5.;

return;

datalines;

01/15/2010 100000 Acct

02/15/2010 125000 Acct

03/15/2010 115000 Acct

04/15/2010 135000 Acct

05/15/2010 140000 Acct

06/15/2010 . Acct

07/15/2010 120000 Acct

08/15/2010 145000 Acct

09/15/2010 160000 Acct

10/15/2010 130000 Acct

11/15/2010 155000 Acct

12/15/2010 150000 Acct

;

run;

goptions reset=symbol;

symbol1 cv=blue value=dot i=join;

proc gplot data=work.expense;

plot expense * date / skipmiss;

run;

quit;

[/pre]

In addition to Scott's suggestions, investigate the SKIPMISS option with PROC GPLOT -- for example, in the data below, the month of June has an observation, but the value for EXPENSE is missing (.) and therefore, the SKIPMISS option tells PROC GPLOT that join should "skip" over the missing value with the line. If your data does not have an observation for June (for example), then the line would be drawn from May - July -- so you might have to put a "dummy" observation into your data for SKIPMISS to work, under that scenario.

cynthia

[pre]

** Missing Y Values;

data expense;

infile datalines;

input date : mmddyy10. expense dept $;

format date monyy5.;

return;

datalines;

01/15/2010 100000 Acct

02/15/2010 125000 Acct

03/15/2010 115000 Acct

04/15/2010 135000 Acct

05/15/2010 140000 Acct

06/15/2010 . Acct

07/15/2010 120000 Acct

08/15/2010 145000 Acct

09/15/2010 160000 Acct

10/15/2010 130000 Acct

11/15/2010 155000 Acct

12/15/2010 150000 Acct

;

run;

goptions reset=symbol;

symbol1 cv=blue value=dot i=join;

proc gplot data=work.expense;

plot expense * date / skipmiss;

run;

quit;

[/pre]

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

01-23-2011 02:17 PM

Thank you for your rapid response Scott and Cynthia. I will check it out.

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

01-25-2011 07:27 PM

Bless you Cynthia, SKIPMISS worked a treat!