My values don't connect in a gplot although I write symbol statements. Does anybody know why this might happen? Here is my code (it shoul produce one line):
symbol1 interpol = join pointlabel height=0.75 line=1 color=CX113388 value=cube;
legend1 label=none position=(bottom center outside);
proc gplot data=mydata;
format num_var1 commax10.2;
plot num_var1 * char_var1 = num_var2 / autovref lautovref = 2 cautovref = CXEEEEEE
vaxis = axis1 haxis = axis2 vreverse
legend = legend1;
axis1 label=("My label" angle=90) minor=none order=(1 to 5 by 1) offset=(1cm);
num_var1 and num_var2 are numeric
char_var1 is character
Everything is done from the symbol statement except the interpol=join.
(I removed the labels, legend and values on the screenshot as it is company data)
One way to control your SAS plots is in 'goption'. For example using SAS example ( it produce a graph like yours):
/* Put this line above your Graph, I put it here. This line is not in SAS example*/
goptions reset=global device=activex ypixels=600 xpixels=800;
length eng $5;
input eng dollars num;
Civil 27308 73273
Aero 29844 70192
Elec 22920 89382
Mech 32816 19601
Chem 28116 25541
Petro 18444 34833
title1 "Member Profile";
title2 "Salaries and Number of Member Engineers";
axis2 order=(0 to 40000 by 10000)
proc gplot data=jobs;
format dollars dollar9. num comma7.0;
bubble dollars*eng=num / haxis=axis1
Then right click on the graph.Select "Graph Properties" and choose what you want. You can connect dots using regression, lines and ... .
@Mahommad: I want the value to be connected at start, not by manually selecting activex options.
@Robert: this works. But now I manipulate my data so that I have two distinct values of num_var2 in the data file. I'd like to have 2 lines then. So I have to include the "= num_var". Then the values aren't connected anymore 😞
Funny thing is that when I leave out "= num_var" I get two lines.
I have nearly the same plot with different data where my plot statement is
plot num_var1 * num_var2 = num_var3
i.e. are variables are numeric. This is the only difference. And here I get all lines for all the values of num_var3
Do you think the var type is the problem?
Don't know if this issue is resolved. Here is SGPLOT solution:
do x=1 to 5;
ods graphics / reset width=5in height=3in imagename='Series';
proc sgplot data=values;
series x=x y=v1 / markers datalabel=v1 markerattrs=(symbol=squarefilled) ;
series x=x y=v2 / markers datalabel=v2 markerattrs=(symbol=squarefilled) ;
yaxis display=(nolabel) reverse;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.