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

I have a dataset which has GROUP | TIMESTAMP | VALUE.

  • GROUP can be 'A' or 'B'
  • TIMESTAMP is a timestamp
  • VALUE is a number

Note: the groups does not overlap in time. For instance, group 'A' has timestamps from jan18 to jun18, while group 'B' has timestamps from nov19 to dec19.

 

I want to plot with sgplot these two time series aside, in "the same row", one on the left one on the right. I tried with sgpanel, but since with sgpanel the time axis is in common it spans from jan18 to dic19, so there is a huge hole in the middle. Instead, I just need to have the first graph on the left with the series 'A' centered in jan18-jun18, and a second graph on the right with the series 'B' centered in nov19-dec19 (so larger, since the timespan is smaller), and with the Y axis "the value" in common.

 

How can I do that?

I hope I made myself clear.

 

Thanks

Regards

T

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You can plot both of these on one PROC SGPLOT and use the RANGES= option of the XAXIS statement to eliminate the "hole" between the two series. https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=grstatproc&docsetTarget=p...

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

You can plot both of these on one PROC SGPLOT and use the RANGES= option of the XAXIS statement to eliminate the "hole" between the two series. https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=grstatproc&docsetTarget=p...

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 473 views
  • 2 likes
  • 2 in conversation