BookmarkSubscribeRSS Feed
Bruger
Calcite | Level 5

Hi,

I am struggling with SGPANEL. I need to change the intervals on the X axis but not the spacing between points. The data points are divided into steps of 5 on a 1440 data points axis. Are there any code that allows for spacing the x axis by say 240? If I use the “colaxis” option, then the space between the data points are also being divided into 240 (as in the example below), which is unwanted.

 

 

options nodate nonumber;

ods _all_ close;

ods rtf file='exp.rtf' startpage=no image_dpi=300;

ods graphics / reset=all outputfmt=png height=3in width=4in;

proc sgpanel data=SGPLOT_1;

  where variabel in ("pred" "smooth");

  title "Daily Variations";

  panelby Day / spacing=5 novarname rows=3  columns=4;

   *ROWAXIS values=(9 to 15 by 1);

 * colaxis values=(0 to 1440 by 240);

  vline min / response=DO group=variabel;

 run;

ods _all_ close;

ods preferences;

 

Thanks

H

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Use a format on the axis values, so setup a format which has ranges of values to code something like:

proc format;
  value...;
    1-10="First"
    11-20="Second";
run;

Then apply the format to your data, and set axis ticks as you do now, should display all the ticks and label only using format.  

Nothing to test this on of course...

Bruger
Calcite | Level 5

HI RW9,

I am not quite sure where you are going! Maybe you could modify the small example below?

Thanks,

 

data SGPLOT_1;
input day DO m h min variabel $50.;
cards;
261 4.159546709 10 15 910 smooth
261 8.701541887 15 15 915 smooth
261 9.239163185 20 15 920 smooth
261 9.410279212 25 15 925 smooth
261 9.455243278 30 15 930 smooth
261 9.479840868 35 15 935 smooth
261 9.489327791 40 15 940 smooth
261 9.522090503 45 15 945 smooth
261 9.53150182 50 15 950 smooth
261 9.519335529 55 15 955 smooth
261 9.524832008 0 16 960 smooth
261 9.547050808 5 16 965 smooth
265 9.894329574 20 5 320 pred
265 9.894329574 25 5 325 pred
265 9.894329574 30 5 330 pred
265 9.894329574 35 5 335 pred
265 9.894329574 40 5 340 pred
265 9.894329574 45 5 345 pred
265 9.894329574 50 5 350 pred
265 9.894329574 55 5 355 pred
265 9.89433014 0 6 360 pred
265 9.89433014 5 6 365 pred
265 9.89433014 10 6 370 pred
265 9.89433014 15 6 375 pred
265 9.89433014 20 6 380 pred
265 9.89433014 25 6 385 pred
265 9.89433014 30 6 390 pred
265 9.89433014 35 6 395 pred
265 9.89433014 40 6 400 pred
265 9.89433014 45 6 405 pred
265 9.89433014 50 6 410 pred
265 9.89433014 55 6 415 pred
265 9.894628018 0 7 420 pred
265 9.894628018 5 7 425 pred
265 9.894628018 10 7 430 pred
265 9.894628018 15 7 435 pred
265 9.894628018 20 7 440 pred
265 9.894628018 25 7 445 pred
265 9.894628018 30 7 450 pred
265 9.894628018 35 7 455 pred
265 9.894628018 40 7 460 pred
265 9.894628018 45 7 465 pred
265 9.894628018 50 7 470 pred
265 9.894628018 55 7 475 pred
265 9.895405669 0 8 480 pred
265 9.895405669 5 8 485 pred
265 9.895405669 10 8 490 pred
265 9.895405669 15 8 495 pred
265 9.895405669 20 8 500 pred
265 9.895405669 25 8 505 pred
265 9.895405669 30 8 510 pred
265 9.895405669 35 8 515 pred
265 9.895405669 40 8 520 pred
;
run;

proc sgpanel data=SGPLOT_1;
where variabel in ("pred" "smooth");
title "Daily Variations";
panelby Day / spacing=5 novarname rows=2 columns=1;
vline min / response=DO group=variabel;
run;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Here is an example:

https://blogs.sas.com/content/graphicallyspeaking/2018/10/10/can-values-on-an-axis-first-decrease-an...

Use the xaxis/yaxis to set values, then apply a format to the value.

 

That blog:

http://blogs.sas.com/content/graphicallyspeaking/

Has thousands of graph types and associated code, its the go to for graphing.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 723 views
  • 0 likes
  • 2 in conversation