BookmarkSubscribeRSS Feed
sfridy
Fluorite | Level 6

Hello,

 

Hopefully a simple ask but I'm looking to adjust how much space each section of my y-axis take up in my graph after splitting. The goal being to stretch out the bottom half more to better see changes. Is there way to dictate that that each section of the y-axis take up say 50% of the graph? So, min-630 take up 50% of the graph and 4699-max take up the other 50%.

 

Thank you

data test;
	input week var1 var2;
	datalines;
1 572 7532
2 580 6638
3 522 5220
4 494 6423
5 555 4749
6 452 4818
7 526 5337
run;

proc sgplot data=test;
	styleattrs axisbreak=spark;
	vline week /response=var1;
	vline week /response=var2;
	yaxis ranges=(min-630 4699-max);
run; 

 

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

As a suggestion, why not use both both y-axes if the sole purpose is to better see the changes? The code is even simpler than it would be to allocate 50 percent of a single y-axis?

 

proc sgplot data=test;
	vline week /response=var1;
	vline week / y2axis response=var2;
run;
Ksharp
Super User
data test;
	input week var1 var2;
	datalines;
1 572 7532
2 580 6638
3 522 5220
4 494 6423
5 555 4749
6 452 4818
7 526 5337
;
run;

proc sgplot data=test;
	*styleattrs axisbreak=spark;
	vline week /response=var1;
	vline week /response=var2;
	yaxis ranges=(min-630 4699-max) type=log
	values=(200,300,400,500,4000,5000,6000,7000);
run; 

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