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

I want to add an extra tick on X axis to existing values (I don't want to change them). How can I do it, could somebody help me?

There is the code:

 

proc sgplot data=pdf2 noautolegend;
title "Posterior Probability Density - Beta Distribution";
series x=x y=y; /*the curve*/
scatter x=x0 y=pdf0; /*the dot*/
vector x=x0 y=pdf0 /xorigin=x0 yorigin=0 noarrowheads datalabel lineattrs=(color=gray); /*the line below the dot*/
band x=x1 lower=0 upper=y1;
xaxis grid label="x"; 
yaxis grid label="Beta Posterior PDF";
refline 0 / axis=y;
run;

 

shot.PNG

and here should be the value x0 = 0.9 (not hardcoded 0.9, x0 can be changed). I use SAS 9.3, I am hope for your help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

ok. I cant see your data, so if it is not structured exactly like this, then modify yourself, but do something like this

 

data somedata;
	do x = 0 to 1 by 0.01;
		y = x*2;
		x0=0.9;
		output;
	end;
	if _N_=1 then call symputx('x0', x0);
run;

title "Some Plot";
proc sgplot data=somedata;
	series x=x y=y;
	xaxis values=(0 to 1 by 0.2 &x0);
run;

 

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

So you want an extra tick value on the x axis corresponding to the value of x0, but not any other ticks (other than the ones that are already there)?

yermapa
Calcite | Level 5
Exactly 😃 Just this graph with extra 0.9 between 0.8 and 1.0 (x0 has only one value 0.9)
PeterClemmensen
Tourmaline | Level 20

ok. I cant see your data, so if it is not structured exactly like this, then modify yourself, but do something like this

 

data somedata;
	do x = 0 to 1 by 0.01;
		y = x*2;
		x0=0.9;
		output;
	end;
	if _N_=1 then call symputx('x0', x0);
run;

title "Some Plot";
proc sgplot data=somedata;
	series x=x y=y;
	xaxis values=(0 to 1 by 0.2 &x0);
run;

 

yermapa
Calcite | Level 5

I thought about it but hoped that there is more simple solution (like some statement). Thank you for your reply, looks like I have to use this approach.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1793 views
  • 1 like
  • 2 in conversation