Data visualization with SAS programming

connecting plot data points on GPLOT: can discontinuity be introduced?

Reply
N/A
Posts: 0

connecting plot data points on GPLOT: can discontinuity be introduced?

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?
Super Contributor
Super Contributor
Posts: 3,174

Re: connecting plot data points on GPLOT: can discontinuity be introduced?

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
SAS Super FREQ
Posts: 8,643

Re: connecting plot data points on GPLOT: can discontinuity be introduced?

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]
N/A
Posts: 0

Re: connecting plot data points on GPLOT: can discontinuity be introduced?

Thank you for your rapid response Scott and Cynthia. I will check it out.
N/A
Posts: 0

Re: connecting plot data points on GPLOT: can discontinuity be introduced?

Bless you Cynthia, SKIPMISS worked a treat!
Post a Question
Discussion Stats
  • 4 replies
  • 143 views
  • 0 likes
  • 3 in conversation