BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

If you are using ODS RTF, the default output type is EMF. Let's take EMF out of equation. Add this statement before your PROC SGPLOT run;

 

ODS GRAPHICS / outputfmt=png;

 

Let me know if that works better.

View solution in original post

18 REPLIES 18
ballardw
Super User

And the question is???

Manvel
Obsidian | Level 7

Is there a way to increase the width for lines and keep their style, I have multiple lines and used "lineattrs = (thickness=2px)" and it works only for first line. Is there another way to increase the line size?

 

DanH_sas
SAS Super FREQ

Is this a grouped SERIES plot, or multiple SERIES statements?

Manvel
Obsidian | Level 7
It is grouped series plot
Tom
Super User Tom
Super User

Provide a working example. Either share some simple data or use one of the SASHELP datasets to demonstrate what you are doing.

Manvel
Obsidian | Level 7
Example provided below
DanH_sas
SAS Super FREQ

Without seeing your code, let me make a few suggestions:

  • Simply setting the line thickness in LINEATTRS is enough to make all grouped lines the same size. If you are losing the line patterns, remove the PATTERN=solid and set ATTRPRIORITY=NONE on the ODS GRAPHICS statement. My guess it that you are using a color-priority style (such as HTMLBLUE).
  • If you need the thickness to vary per value in another variable, you can use the THICKRESP=<variable> option on the SERIES plot to vary the thicknesses of you grouped lines.

Hope this helps!

Dan

Manvel
Obsidian | Level 7
proc sgplot data=final(where=(paramcd="TEST")) noautolegend ;
    by lbnam paramcd paramtxt lbtest2;    
    ods output sgplot=sg; 
    Title7 justify=left "#BYVAL4";
  series  X=X_ Y=cMean / group = TRT01A markers  groupdisplay=cluster /*overlay*/ clusterwidth=0.15 name="T10" lineattrs=(thickness=2px);
  scatter X=X_ Y=cMean / group = TRT01A yerrorlower=Lower yerrorupper=Upper  groupdisplay=cluster /*overlay */ clusterwidth=0.15 markerattrs=(size=11px) errorbarattrs=(thickness=2px);

  keylegend 'T10' / noborder down=1;

  yaxis  min=&minl max=&maxu valueattrs=(size=10) valueshint label=/*"&ytitle."*/ "Mean Change from Baseline (+/-SE)" labelattrs=(size=10);   

  xaxis min=1 max=2 values=(1 to 2 by 1) valueattrs=(size=10) valuesdisplay=('Baseline' 'Week X') valueshint label="Visit" labelattrs=(size=10);  

run;

This is a code example which works in my end and it is getting me this result(picture below), If I will add "pattern=solid" it will remove all line attribute and type. Error bars worked correctly.

 

Manvel_3-1684913710173.png

 

 

ballardw
Super User

You might consider showing the code with the "pattern=solid". There a different places that could be used and results would vary.

Manvel
Obsidian | Level 7
proc sgplot data=final(where=(paramcd="TEST")) noautolegend ;
by lbnam paramcd paramtxt lbtest2;
ods output sgplot=sg;
Title7 justify=left "#BYVAL4";
series X=X_ Y=cMean / group = TRT01A markers groupdisplay=cluster /*overlay*/ clusterwidth=0.15 name="T10" lineattrs=(thickness=2px pattern=solid); *there used pattern solid;
scatter X=X_ Y=cMean / group = TRT01A yerrorlower=Lower yerrorupper=Upper groupdisplay=cluster /*overlay */ clusterwidth=0.15 markerattrs=(size=11px) errorbarattrs=(thickness=2px);

keylegend 'T10' / noborder down=1;

yaxis min=&minl max=&maxu valueattrs=(size=10) valueshint label=/*"&ytitle."*/ "Mean Change from Baseline (+/-SE)" labelattrs=(size=10);

xaxis min=1 max=2 values=(1 to 2 by 1) valueattrs=(size=10) valuesdisplay=('Baseline' 'Week X') valueshint label="Visit" labelattrs=(size=10);

run;




I tried to put line attributes manually for example half of them solid and other dash and only solid works(that one I tried when I didn’t have “”patterns=solid”
DanH_sas
SAS Super FREQ

Just to have a data point, please try the code below and tell me if you see the correct thicknesses:

 

data test;
do g=1 to 5;
   x=0;
   y=0;
   output;
   x=ranuni(123);
   y=ranuni(321);
   output;
end;
run;

ods graphics / attrpriority=none;
proc sgplot data=test;
series x=x y=y / group=g lineattrs=(thickness=2px);
run;
Manvel
Obsidian | Level 7

Yep man it is correct and lines size is changing for all of them.

 

DanH_sas
SAS Super FREQ

Is this PNG or SVG output? What is the output type? HTML? PDF?

Manvel
Obsidian | Level 7

In my end it is RTF and I need to have that and not changing STYLE part

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 18 replies
  • 1507 views
  • 2 likes
  • 4 in conversation