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 Procedures
- /
- what is the graphing procedure

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

02-19-2015 12:23 AM

hi all,

in proc gplot i have one doubt

i attached one graph in rtf file. see that

x;5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100

y;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

the data is like this. this is i have to plot on a graph

AXIS1 LABEL=('Cumulative of employees');

AXIS2 LABEL=(ANGLE=90 'Cumulative of salaries);

PROC GPLOT DATA=ds;

PLOT Y*X /HAXIS=AXIS1 VAXIS=AXIS2;

RUN;

QUIT;

x-axis employees

y-axis salaries informatio

PLOT procedure all y are plotted on graph depend on x values. the graph is ok.

but my requirement is that i want to emphasis on 50 and 75 values on y axis. i.e. some mart tick on these points 50 and 75.

graph is appeared but points are not appeared only 50 and 75 points are appeared with some emphasis on it. some color

taking y values 1 to 20 . But only x values represent 50 and 75 in over all graph. and emphasis on this points with some color or mark for understanding purpose these two are maximum.

how to do this can any one suggest me

thanks in advance.

1

Message was edited by: ravikumar kummari

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

02-19-2015 04:03 AM

Hi,

My suggestion is to move from gplot (old tech) to sgplot and graph template language which will be the tech going forward. These allow you far more control over your outputs and link in with all the other ods goodness as well. If you need examples have a look at this blog which gives detailed examples of pretty much every graph imaginable: http://blogs.sas.com/content/graphicallyspeaking/

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

02-19-2015 04:13 AM

I am not aware of proc sgplot and i searched in your link but the curve information is not available.

if you don't mind could you please post the answer how this is done.

thanks

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

02-19-2015 04:23 AM

Proc sgplot has been around since at least version 9.0. It was brought in to replace gplot as it allows more flexibility and interaction with templates and ods. The plot you are talking about is called a series plot, and examples can be found here:

proc sgplot example (second code snippet): http://blogs.sas.com/content/graphicallyspeaking/?s=sgplot+series

GTL example: http://blogs.sas.com/content/graphicallyspeaking/2014/04/27/multi-group-series-plots/

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

02-19-2015 04:33 AM

yours links are good and useful. there is a huge information in links.

Definitely i will refer your links. But not now. If you know the answer of my post please comment.

Thanks in advance.

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

02-19-2015 10:57 AM

I'm not quite sure about what type of emphasis you want. You could draw horizontal lines across the graph from the Y values of 50 and 100 with

PLOT Y*X /HAXIS=AXIS1 VAXIS=AXIS2

HRef=(50,100)

;

Since your example graph shows no values of 200 and 300 there's nothing to suggest.

If you want to restrict which points are displayed then you could use datasets options

PROC GPLOT DATA=ds (where=(50 le x le100)) ;

A third variable to group responses such as

plot x*y=group will change the appearance of markers and lines for those points but data order and other considerations come in that require more specific information about your data and what you need.

without knowing what kind of emphasis is desired hard to help much more.

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

02-20-2015 12:12 AM

You are not understand my point i think.

i want the output like the graph what ever i shown in ms word appear as it is there is no changes in that. the major change is that there is dot(.) points to all Y values so instead of all values displaying only 50 and 75 points in graph.The graph as usual shown what ever it is.

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

02-20-2015 09:11 AM

Hi:

No matter which technology you use: SAS/GRAPH and PROC GPLOT or ODS GRAPHICS and SGPLOT, each method of making a graph will produce an image. If you need "extra" emphasis on the image or extra reference lines or some modification to the tick marks then you have 2 ways to accomplish what you want:

1) research your method to see if there is a procedure statement or global statement to do what you want OR

2) add your own annotations to the graph. Both methods of doing graphs have ANNOTATE capabilities.

The SG Procedures were first production in SAS version 9.2 and the ANNOTATE facility for the SG Procedures have been production since SAS 9.3. In addition, there is a separate forum for graphing questions that is a better place to ask your question. In one of your posts, you said that "i want to emphasis on 50 and 100 values on y axis. i.e. some mart tick on these points 50 and 75." and to me, this either means you want to draw an extra reference line at 50 and 100, which is possible with either graph method (look up reference lines) or you want to do something like draw an arrow pointing to 50 and an arrow pointing to 100, which is possible with ANNOTATE.

cynthia

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

05-02-2015 03:55 AM

please comment.

what my requirement is that i want to display only two points on y axis.

i.e. 50 and 75. along with total graph.

i clearly mentioning here along with graph no need all points on graph. only 50 and 75 points appeared on graph.

any help would be much appreciated.

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

05-02-2015 04:04 AM

how to control the midpoints in proc gplot

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

05-02-2015 11:18 AM

Hi, the reason I didn't really focus on your Word document was that your X axis went to 10000 and your Y axis went from 0 to 100. But with your sample data, your Y values only went from 1 to 20 and your X values were from 5 to 100, so It seems like your sample data could not have been used to make the graph in your Word document.

The way to control the tick marks is through your AXIS statement. You are only using your AXIS statement for labels, but it has many, many ways for you to tailor the way the AXIS looks. Or, depending on the level of control you want, as I said in my previous posting, you might have to look at using ANNOTATE to put your own custom tick marks.

cynthia

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

05-04-2015 06:35 AM

how to do the same process using proc sgplot.

i tried some code using proc sgplot.

data Class;

set YEAR_2010;

Label = Y;

if Y NOT in (50,75) then

Label = " ";

run;

proc sgplot data=CLASS;

title 'Highlight a Value on a Graph';

series x=X y=Y;

scatter x=X y=Y /DATALABEL=LABEL;

run;

here what happen i am getting the result but all points are displaying in graph.

what my requirement is that i want to display only two points on graph. i.e. 50 and 75 on y-AXIS,