BookmarkSubscribeRSS Feed
Ahmad
Calcite | Level 5

HI i am creating graphs using GPLOT , (specifically ploting prices against time) using by statement (Stock name), i get more than 100 graphs and i want to have 10 graphs per page as an output, NEED HELP URGENTLY

8 REPLIES 8
PGStats
Opal | Level 21

You can use GREPLAY to 1) define the page layout for 10 graphs and 2) associate each set of 10 graphs, in turn, to your template. - PG

PG
Ahmad
Calcite | Level 5

I al having problems defining the layout can you please guide me how to , because such a template doesnot exist in built in templates , and further more if i use builtin templates it gives me a singe page and not multiple pages

PGStats
Opal | Level 21

I haven't used GREPLAY in ages. Basically, I never had the patience to get the result that I wanted. I much prefer SGPANEL for this kind of graph layout. Consider :

data test;
call streaminit(87575);
value = 100;
do stock = 1 to 100;
     do time = 1 to 20;
          value + rand("NORMAL",0,5);
          output;
          end;
     end;
run;

proc sgpanel data=test;
panelby stock / layout=panel rows=5 columns=2;
series x=time y=value;
run;

hth

PG

PG
GraphGuy
Meteorite | Level 14

When you say you want "10 graphs per page as an output", what form do you want this output to be in? ...

A web page, printed page, physical computer screen, pdf document pages, html pages, 10 graphs per png image, other?

MikeZdeb
Rhodochrosite | Level 12

hi ... the attached SAS code produced the attached PDF file (I'm sure Robert will also have ideas) .. the PNG file is just a screen capture of the PDF output

given that you'll accept PDF output, it's easy to place output from SAS/Graph PROCs at various locations on a page using GOPTIONS (vorigin and horigin)

you can also specify the size of the output from SAS/Graph PROCs with GOPTIONS (hsize and vsize)

if you look at any of the maps on this page ... http://www.health.ny.gov/statistics/chac/chds.htm ... the horizontal bar chart and map were placed on the same page using the method shown in the attached SAS code (just scroll down and click on any map link)


ten_things.png
Ahmad
Calcite | Level 5

cant see any attached code, new to this forum so dont really know how it works

MikeZdeb
Rhodochrosite | Level 12

hi ... the SAS code is in the TEN_THINGS_SAS.ZIP that's attcahed (along with the PDF and PNG files) to my posting

just in case that's still a problem ...

proc sort data=sashelp.class out=class;

by height;

run;

ods results off;

ods listing close;

* use startpage=never to keep adding to a single page;

ods pdf file='z:\ten_things.pdf' notoc startpage=never;

options orientation=landscape;

* title for all ten "plots";

goptions reset=all border ftext='calibri' htext=2.5;

proc gslide;

title 'TEN "DIFFERENT" THINGS FROM SAS/GRAPH GPLOT AND GSLIDE ON ONE PAGE' ls=2;

run;

quit;

* resize graphics output to 2x3 inches;

goptions reset=all border ftext='calibri' gunit=pct htext=3 hsize=2in vsize=3in;

symbol1 v=dot i=join h=2 c=blue;

axis1 label=(a=90);


* use horigin and vorigin to place output on the page;

* 5 charts from GPLOT;

proc gplot data=class;

title 'PLOT #1' ls=2;

goptions horigin=0.4in vorigin=1.0in;

plot weight*height / vaxis=axis1;

run;

title 'PLOT #2' ls=2;

goptions horigin=2.45in;

plot weight*height / vaxis=axis1;

run;

title 'PLOT #3' ls=2;

goptions horigin=4.5in;

plot weight*height / vaxis=axis1;

run;

title 'PLOT #4' ls=2;

goptions horigin=6.6in;

plot weight*height / vaxis=axis1;

run;

title 'PLOT #5' ls=2;

goptions horigin=8.65in;

plot weight*height / vaxis=axis1;

run;

quit;


* 5 charts from GLSIDE;

proc gslide;

title 'GSLIDE #1' ls=2;

goptions horigin=0.4in vorigin=4.25in;

run;

title 'GSLIDE #2' ls=2;

goptions horigin=2.45in;

run;

title 'GSLIDE #3' ls=2;

goptions horigin=4.5in;

run;

title 'GSLIDE #4' ls=2;

goptions horigin=6.6in;

run;

title 'GSLIDE #5' ls=2;

goptions horigin=8.65in;

run;

quit;


ods pdf close;

ods listing;

ods results;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 8 replies
  • 2175 views
  • 1 like
  • 4 in conversation