Hi,
The marker format of curve labelled Taichung could not run, please see attachment file. My software is SAS 9.4.
Here is the program:
proc import datafile= 'c:\sasabc\rain.xlsx' out=testrain replace;
sheet='kkk';
run;
proc sgplot data=testrain;
series y=taipei_rain x=month / legendlabel = 'Taipei' markers lineattrs = (thickness = 2 color=tan pattern=15);
series y=taichung_rain x=month / LEGENDLABEL = 'Taichung' markerattrs=(symbol=circle color=blue size=3) lineattrs = (thickness = 2);
/*The marker format of taichung could not be run. Please help solve. */
series y=kaohsiung_rain x=month / LEGENDLABEL = 'Kaohsiung' markers lineattrs = (thickness = 2);
xaxis type=discrete grid;
yaxis label='taiwan rain' grid values= (0 to 1100 by 50);
run;
Your first example specified markerattrs but not markers. So I told you to add markers. So instead, you changed markerattrs to markers, so I told you again to go back to your original code and add markers. In your last one, you did not specify markerattrs. Again, add Markers to your original code. Don't change some other option.
Try adding the MARKERS option to that SERIES statement.
Hi,
I try to add the markers option, the question still exists.
I refer to the resource 'http://support.sas.com/documentation/cdl/en/grstatug/63302/HTML/default/viewer.htm#p0qap3adaorc06n19...'
, writing the code. However, the question (bugs ?) still exists.
You did not do what I said. Add the Markers option to your original code, just like you had it in the other statements.
At present, I learn to write the proc sgplot code, including its statements and options, such as lineattrs and markerattrs. By way of web resource, I learn to change the format of line via lineattrs option. In addition, I can add the markers option to produce the marker at the data point of broken line chart. The sas code is to be as follows:
series y=taichung_rain x=month / LEGENDLABEL = 'Taichung' markers lineattrs = (thickness = 2);
I also find that I can change the marker format of broken line chart via the statement markerattrs.
(refenence: http://support.sas.com/documentation/cdl/en/grstatug/63302/HTML/default/viewer.htm#p0qap3adaorc06n19...)
However, I use the method but the program don't successfully run. Therefore, my question is why the markerattrs option cannot run.
Thank you for your reply
Your first example specified markerattrs but not markers. So I told you to add markers. So instead, you changed markerattrs to markers, so I told you again to go back to your original code and add markers. In your last one, you did not specify markerattrs. Again, add Markers to your original code. Don't change some other option.
The question has been solved; the correct answer is posted for all to see.
series y=taichung_rain x=month / LEGENDLABEL = 'Taichung' markers markerattrs=(symbol=starfilled color=blue size=10 ) lineattrs = (thickness = 2);
Thank you so much for the speedy reply.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.