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/GRAPH and ODS Graphics
- /
- Plot 2 different range values on X axis,

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

06-28-2010 02:23 AM

Hi-,

I am trying to create a PK graph. The time values on X axis are 2,4,6.5,9,200,250,400,600,690,710 weeks.

I would like to present 2 to 9 weeks first on the x-axis then break the X-axis and present remaining 200 to 710 weeks on X-axis. Otherwise, 2 to 9 weeks were displayed so close they almost appear as one data point on X-axis. For this reason i would like to present them as 2 different ranges (2-9 and 200 and 710).

Please note that i want to preserve the distance between 2 data points on x-axis meaning the distance between data point 2 and 4 should be less than distance between .4 and 6.5, similarly distance between 600 and 690 should be more than distance between 690 and 710. I do not want to present these with same distance between them,...

Please let me know if you know how to do it,...

Thanks

Thanks

I am trying to create a PK graph. The time values on X axis are 2,4,6.5,9,200,250,400,600,690,710 weeks.

I would like to present 2 to 9 weeks first on the x-axis then break the X-axis and present remaining 200 to 710 weeks on X-axis. Otherwise, 2 to 9 weeks were displayed so close they almost appear as one data point on X-axis. For this reason i would like to present them as 2 different ranges (2-9 and 200 and 710).

Please note that i want to preserve the distance between 2 data points on x-axis meaning the distance between data point 2 and 4 should be less than distance between .4 and 6.5, similarly distance between 600 and 690 should be more than distance between 690 and 710. I do not want to present these with same distance between them,...

Please let me know if you know how to do it,...

Thanks

Thanks

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

Posted in reply to deleted_user

06-28-2010 03:56 PM

If you have SAS 9.2, you can use ODS Graphics to do it. Basically, the two range are put into two cells of a lattice. the axis values are naturally placed in their location in linear space. I'm not sure of the appearance details you want, so just try this example and ask me any questions you have about it.

Thanks!

Dan

[pre]

data smalldata;

input x1 y1;

cards;

2 200

4 400

6.5 650

9 900

;

run;

data bigdata;

input x2 y2;

cards;

200 200

250 250

400 400

600 600

690 690

710 710

;

run;

data realdata;

merge smalldata bigdata;

run;

proc template;

define statgraph broken;

dynamic list1 list2;

begingraph;

layout lattice / columns=2 columngutter=3;

layout overlay / walldisplay=(fill) xaxisopts=(linearopts=(tickvaluelist=list1));

scatterplot x=x1 y=y1;

endlayout;

layout overlay / walldisplay=(fill) yaxisopts=(display=none)

xaxisopts=(linearopts=(tickvaluelist=list2));

scatterplot x=x2 y=y2;

endlayout;

endlayout;

endgraph;

end;

run;

proc sgrender data=realdata template=broken;

dynamic list1="2 4 6.5 9" list2="200 250 400 600 690 710";

run;

[/pre]

Thanks!

Dan

[pre]

data smalldata;

input x1 y1;

cards;

2 200

4 400

6.5 650

9 900

;

run;

data bigdata;

input x2 y2;

cards;

200 200

250 250

400 400

600 600

690 690

710 710

;

run;

data realdata;

merge smalldata bigdata;

run;

proc template;

define statgraph broken;

dynamic list1 list2;

begingraph;

layout lattice / columns=2 columngutter=3;

layout overlay / walldisplay=(fill) xaxisopts=(linearopts=(tickvaluelist=list1));

scatterplot x=x1 y=y1;

endlayout;

layout overlay / walldisplay=(fill) yaxisopts=(display=none)

xaxisopts=(linearopts=(tickvaluelist=list2));

scatterplot x=x2 y=y2;

endlayout;

endlayout;

endgraph;

end;

run;

proc sgrender data=realdata template=broken;

dynamic list1="2 4 6.5 9" list2="200 250 400 600 690 710";

run;

[/pre]

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

Posted in reply to deleted_user

06-28-2010 10:45 PM

Hi Dan,

Thank you very much for you reply.

Unfortunately I am using sas 9.1 and I did not find any solution for this in 9.1.

Please let me know if you think otherwise,..

Thanks

Thank you very much for you reply.

Unfortunately I am using sas 9.1 and I did not find any solution for this in 9.1.

Please let me know if you think otherwise,..

Thanks

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

Posted in reply to deleted_user

06-29-2010 10:22 AM

perhaps you could use "dummy" values for the axis to force the distances and then use the tick mark options to label the tick marks with the desired values ...

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

Posted in reply to deleted_user

06-30-2010 12:56 PM

Hi Bill,

Thanks for your reply.

Yes, the dummy coding works in some cases. But statistician is not ok with this approach,..

Thanks,...

Thanks for your reply.

Yes, the dummy coding works in some cases. But statistician is not ok with this approach,..

Thanks,...

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

Posted in reply to deleted_user

06-30-2010 01:33 PM

There is a graph example on support.sas.com "Sample 24909: Create a 'break' on the vertical axis of a plot" that might be helpful to you.

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

Posted in reply to RickM

07-01-2010 02:51 PM

HI RICK M,

Thanks for the info. It is really helpful, and this is what I am looking for,..

Thanks again

Thanks for the info. It is really helpful, and this is what I am looking for,..

Thanks again