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;
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.
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;
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)?
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;
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.
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!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: