BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NareshAbburi
Calcite | Level 5

Hi,

I'm plotting a gplot in SAS 9.3, I'm not sure what mistake am I doing that it is not plotting lines on all the cases of my graph. the line is plotting for only one case.

Please refer to the attached graph.

Please help me to resolve this.

Naresh


Gplot.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

In that case, the easiest way is to leave the color= off the symbol statement, and let it take colors from the ods style that is in use. Something like this:

goptions reset=symbol;

symbol1 value=dot interpol=join repeat=3;

proc gplot data=sashelp.stocks;

plot close*date=stock;

run;

If you want to control the color of each line, you'll need a symbol statement for each line, such as ...

goptions reset=symbol;

symbol1 value=dot interpol=join color=red repeat=1;

symbol2 value=dot interpol=join color=pink repeat=1;

symbol3 value=dot interpol=join color=purple repeat=1;

proc gplot data=sashelp.stocks;

plot close*date=stock;

run;

View solution in original post

5 REPLIES 5
ballardw
Super User

Looks like you need additional SYMBOL statements with the I=Join option. This will also let you define more interesting markers.

You need one symbol statement for each response category to customize appearance.

NareshAbburi
Calcite | Level 5

Hi,

What do you mean by additional symbol options. Could you please provide me some details.

here is my code.

I've already used symbol option with join.

*PLOTTING*/

symbol1 interpol=join value=dot;

AXIS1 LABEL = NONE ORDER = &cutoffweek. TO &lastfullweek.;

PROC GPLOT DATA = PCT_OSBYTIME&clientname.;

  TITLE "OS Usage Overtime - &clientname.";

  PLOT PCT_USAGE * WEEK = OS  / haxis= AXIS1 ;

/* PLOT PCT_USAGE * WEEK = OS;*/

RUN;

PROC GPLOT DATA = PCT_BROWSERBYTIME&clientname.;

  TITLE "Browser Usage Overtime - &clientname.";

  PLOT PCT_USAGE * WEEK = BROWSER  / haxis= AXIS1;

/* PLOT PCT_USAGE * WEEK = BROWSER;*/

RUN;

/* Define symbol characteristics */                                                                                                   

symbol1 color=vibg interpol=join value=dot;

PROC GPLOT DATA = PCT_RESLNBYTIME&clientname.;

  TITLE "Screen size usage Overtime - &clientname.";

  PLOT PCT_USAGE * WEEK = WIDTHBIN  / haxis= AXIS1;

/* PLOT PCT_USAGE * WEEK = WIDTHBIN ;*/

RUN;

GraphGuy
Meteorite | Level 14

It could depend on how your data is structured - are you using "plot y*x=browser" or do you have a separate y-variable for each browser (which you 'overlay')? And it might also depend on whether you're using a traditional device such as png, or activex (or java).

Anyway, here's an example that shows one way to create a plot like what it appears you're wanting:

http://www.robslink.com/SAS/democd59/browser_wars.htm

http://www.robslink.com/SAS/democd59/browser_wars_info.htm

browser_wars.png

NareshAbburi
Calcite | Level 5

Hi,

I don't have separate y variable for each category. I've single PCT variable for all the categories.

Please refer to the attached image.

plot1.PNG

GraphGuy
Meteorite | Level 14

In that case, the easiest way is to leave the color= off the symbol statement, and let it take colors from the ods style that is in use. Something like this:

goptions reset=symbol;

symbol1 value=dot interpol=join repeat=3;

proc gplot data=sashelp.stocks;

plot close*date=stock;

run;

If you want to control the color of each line, you'll need a symbol statement for each line, such as ...

goptions reset=symbol;

symbol1 value=dot interpol=join color=red repeat=1;

symbol2 value=dot interpol=join color=pink repeat=1;

symbol3 value=dot interpol=join color=purple repeat=1;

proc gplot data=sashelp.stocks;

plot close*date=stock;

run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1413 views
  • 0 likes
  • 3 in conversation