- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have the SGplot below. But the axis has some issues.
1) X and Y axes are too light in shading & the numbers for calculated concentration and hours need to be black & bold. Can anyone help?
2)The color of the plot is blue, how do I change it to red?
3) Once the figures are color-coded, can they be saved as a picture to conserve space
PROC SGPLOT DATA=Uplex1;
where Biomarker in ('IL-6');
VLINE Time /RESPONSE=data2 STAT=Mean group=Biomarker
MARKERS LINEATTRS = (THICKNESS = 3);
yaxis label=' Log Concentration';
xaxis label='Time in Hours' values=(0 to 72 by 12);
RUN;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%sganno
data sganno;
%SGLINE(X1=0, Y1=0, X2=0,Y2=100, DRAWSPACE="WALLPERCENT" ,LINECOLOR="black", LINEPATTERN="SOLID", LINETHICKNESS=4)
%SGLINE(X1=0, Y1=0, X2=100,Y2=0, DRAWSPACE="WALLPERCENT" ,LINECOLOR="black", LINEPATTERN="SOLID", LINETHICKNESS=4)
run;
proc sgplot data=sashelp.class sganno=sganno;
scatter x=weight y=height;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@desireatem wrote:
1) X and Y axes are too light in shading & the numbers for calculated concentration and hours need to be black & bold. Can anyone help?
They look black to me, not sure what "too light in shading means" but try this:
xaxis valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold);
and similarly in the yaxis statement
2)The color of the plot is blue, how do I change it to red?
You already use the LINEATTRS= option. All of this is addressed in the PROC SGPLOT documentation under the LINEATTRS= option.
3) Once the figures are color-coded, can they be saved as a picture to conserve space
All PROC SGPLOT output can be saved, in many different ways, including copy/paste, or via ODS. There are many ODS destinations that will store your graphics in files with names that you specify, in folders that you specify, such as ODS HTML, ODS EXCEL, ODS PRINTER and probably 14 other destinations. Do you have a specific output requirement, such as a PNG file, or an Excel file? PS: I'm not sure that this saves any space.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I am close. Is there a way to make the axis denser, this is the lines, they are thin? The X and Y axes are too thin, can I make them denser?
TITLE " Biomarker concerntration within 72 hours";
PROC SGPLOT DATA=Uplex1;
where Biomarker in ('IL-6');
VLINE Time /RESPONSE=data2 STAT=Mean group=Biomarker
MARKERS LINEATTRS = (THICKNESS = 2 color=red);
YAXIS label=' Log Concentration' valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold );
*xaxis valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold );
xaxis label='Time in Hours' values=(0 to 72 by 12) valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold );
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This shows me how to color the axes but not to make them denser. I try the code on the link without sucess
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I disagree, there is specific code to make the line thickness 8px
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc template; define style styles.axis; parent=styles.htmlblue; class GraphAxisLines / contrastcolor=red linethickness=4; end; run; ods html5 file = '/home/fkhurshed/Demo1/demo.html' style=axis; proc sgplot data=sashelp.class; scatter x=weight y=height; run; ods html5 close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It didn't work:
proc template;
define style styles.axis;
parent=styles.htmlblue;
class GraphAxisLines /
contrastcolor=red
linethickness=4;
end;
run;
PROC SGPLOT DATA=data31;
VLINE Time /RESPONSE=data1 STAT=Mean group=Biomarker
MARKERS LINEATTRS = (THICKNESS = 3 color=green) ;
YAXIS label=' Calculated Concentration (pg/mL)' valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold );
*xaxis valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold );
xaxis label='Time in Hours' values=(0 to 72 by 12) valuesattrs=(Color=black Family=Arial Size=12 Style=Italic Weight=Bold );
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I do not understand !
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
%sganno
data sganno;
%SGLINE(X1=0, Y1=0, X2=0,Y2=100, DRAWSPACE="WALLPERCENT" ,LINECOLOR="black", LINEPATTERN="SOLID", LINETHICKNESS=4)
%SGLINE(X1=0, Y1=0, X2=100,Y2=0, DRAWSPACE="WALLPERCENT" ,LINECOLOR="black", LINEPATTERN="SOLID", LINETHICKNESS=4)
run;
proc sgplot data=sashelp.class sganno=sganno;
scatter x=weight y=height;
run;