BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
yabwon
Amethyst | Level 16

For `colorList=` do it like this:

 

data have;
  g = "Aaa";
  do _N_ = 1 to 50;
    x = rannor(42);
    output;
  end;

  g = "Bb";
  do _N_ = 1 to 120;
    x = rannor(42);
    output;
  end;

  g = "C";
  do _N_ = 1 to 60;
    x = rannor(42);
    output;
  end;
run;

%RainCloudPlot(have, g, x, colorsList=CX0072B2 CXF0E442 CXCC79A7)

Basically list colours as comma separated string.

 

Bart

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



grsanford
Fluorite | Level 6

Bart

I've now almost got it (see below). I have gotten the formatting, annotation, and color to work. I did get a warning when I tried to specify the size of the raw datapoints using rainDropSiz (ERROR: The keyword parameter RAINDROPSIZ was not defined with the macro.). I am also wondering how I can change the size, weight, etc. of the Y and X axis lables, in this case "Cropping System" and "POx-C mg/cm2". I have been able to manipulate the size of the scale values using  xaxisValueAttrs=size=12 but can't get past that. When using this type of format for xaxisValueAttrs, how would I specify multiple arguments (e.g. size, weight, ...)? Would it be xaxisValueAttrs=size=12 weight="bold" etc.?

 

This is really cool and I am super impressed with what you have put together!   

 

%RainCloudPlot(
SI_ESM_2022
  , systrt
  , pox_mg_cm2
  , HeightPX=300 
  , WidthPX=900
  , boxPlotSymbolSize=15
  , catLabels=("Cropping System")
  , colorslist=CX88CCEE CX44AA99 CX117733
  , xLabels="POx-C (mg/cm2)"
  , y2axis=0
  , xaxisValueAttrs=size=12
  , Kernel_K=quadratic
  , sganno=poxAnno
  , formated=1)

 

raincloud plot.png

 

yabwon
Amethyst | Level 16

Hi,

It should be raindropsizE there was a spelling in the doc, I fixed it in new release,  in the "syntax" part you can see

<,rainDropSize=>

my mistake, sorry.

 

I added new parameters, install and load BasePlus 1.24.2 and you will be able to run:

data poxAnno; 
  function="text";
  label="This graph is full(*ESC*){sup '2'} of annotations!";
  drawspace="graphpercent";
  rotate=30;
  anchor="center";
  textsize=32;
  x1=50;
  y1=50;
  textcolor="red"; 
  justify="center";
  textweight="bold";
  width=100;
  widthunit="percent";
run; 

proc format;
  value system
  1="Windows"
  2="MacOS"
  3="Linux"
  ;
run;

data test;
  do system = 1 to 3;
    do i = 1 to 30;
      x = rannor(123)/system;
      output;
    end;
  end;
  format system system.;
run;


%RainCloudPlot(test, system, x
, HeightPX=300 
, WidthPX=900
, boxPlotSymbolSize=15
, catLabels=("Cropping System")
, colorslist=CX88CCEE CX44AA99 CX117733
, xLabels="POx-C (mg/cm2)"
, y2axis=0
, xaxisValueAttrs=size=12 color=RED
, Kernel_K=quadratic
, sganno=poxAnno
, formated=1

,rainDropSize=10px
,catLabelAttrs=size=12 color=RED weight=bold
,xLabelAttrs=size=12 color=Pink weight=bold
)

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



grsanford
Fluorite | Level 6

Bart

 

That worked. I can't thank you enough for all of your help with this. Final Q, I PROMISE. Is there a way to format the group variable (size, weight, color)?

 

raincloud plot.png

yabwon
Amethyst | Level 16

Get yourself the latest BasePlus (1.26.1) package and use the `catAxisValueAttrs parameter 🙂

 

%RainCloudPlot(
    sashelp.cars(where=(Type ne "Hybrid"))
  , Origin
  , Invoice 
  , HeightPX=300 
  , y2axisLevels=3
  , catLabels=("Continent of Origin")
  , xLabels="Invoice, [$]"
  , xLabelAttrs=size=12 color=Pink weight=bold
  , catAxisValueAttrs=size=10 color=Red weight=bold /* <--- new parameter */
  )

Your questions are giving me motivation to improve the BasePlus so feel free to ask as many as you want 🙂

 

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



grsanford
Fluorite | Level 6

Bart

Thank you for your help and willingness to entertain more questions. I think you've answered all the qeustions that I have for now. 😎

 

I DO think a couple things that would be fantastic additions for future interations would be: 

 

1. The ability to rotate the figure 90 degrees so that the box plots were verticle and the data and distribution were to their sides with the lables at top.

2. The ability to manipulate the box plot: change outline, tails, etc.

3. The ability to manipulate the distribution: format outline, insert mean and quartile lines, etc.

 

The program is FANTASTIC as it stands and I am so grateful that you created it. Just sharing some thoughts that have run through my brain while learnign how to use this. Thank you again!

yabwon
Amethyst | Level 16

Hi @grsanford ,

 

I did some updates to the %RainCloudPlot() macro.

It doesn't jet cover your list fully but still you my find it interesting, especially the Example 4. 

Link: https://github.com/SASPAC/baseplus/blob/main/baseplus.md

 

 

All the best

Bart

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



grsanford
Fluorite | Level 6

@yabwon, this is fantastic! Thank you for the upate. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 22 replies
  • 8975 views
  • 3 likes
  • 4 in conversation