<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to create boxplot overlay on violin plot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/892762#M24079</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/404332"&gt;@xinlong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hello, can I learn about how you deal with this problem that&amp;nbsp;create boxplot overlay on violin plot?&amp;nbsp;&amp;nbsp;I have the same question.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;On this forum we prefer that you start a new thread and when related to a previous one to provide a link the other thread(s) by copying the url and pasting in you question box.&lt;/P&gt;
&lt;P&gt;That way we can tell where your responses to questions are different from the poster of the original question and readers don't get confused.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a good idea to include some example data in the form of a working data step and what you have so far. Many approaches to graphing rely on the content of a data file and we can't tell what may be needed with your data without an example. Best is also to include the code you have such as your violin plot as a starting point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also Boxplots have a LOT of options. Which features from the box plot do you need?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2023 15:23:23 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-09-05T15:23:23Z</dc:date>
    <item>
      <title>How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507041#M17266</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create side by side violin plots (with 2 plots representing percentages of 2 groups) , with a boxplot overlay (the boxplot within showing mean, IQR and confidence intervals). Although I've been able to create the violin plot on its own, I am not sure how to create the boxplot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with a continuous variable&amp;nbsp;(percentage) and binary variable (disease). My original code, for the violin plots only, is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort&lt;BR /&gt;data = adherence&amp;nbsp;&lt;BR /&gt;out=sorted;&lt;BR /&gt;by &amp;nbsp;percentage;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc kde&lt;BR /&gt;data = sorted;&lt;BR /&gt;by disease;&lt;BR /&gt;univar percentage&amp;nbsp;/ plots=none out = percent_dens;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data plot;&lt;BR /&gt;set percent_dens;&lt;BR /&gt;mirror=-density;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgpanel data=plot nocycleattrs;&lt;BR /&gt;panelby DisType / layout=columnlattice onepanel novarname noborder colheaderpos=bottom;&lt;BR /&gt;band y=value upper=density lower=mirror / fill outline;&lt;/P&gt;&lt;P&gt;rowaxis label="MY GRAPH" grid;&lt;/P&gt;&lt;P&gt;colaxis display=none;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is there any way to do this on SAS? At the very least, I would want to include more detail to my violin plot, such as mean, median, and IQR (similar to what a boxplot can tell us....but on the violin plot). Is this an alternate, more feasible&amp;nbsp;solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would really appreciate if someone could help me out with this problem. There does not seem to a wealth of knowledge on the internet, as the use of violin plots seems to be fairly new (?). Also,&amp;nbsp;I am a novice at using SAS, so any comments or tips would be helpful!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;Christina&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 00:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507041#M17266</guid>
      <dc:creator>csh2157</dc:creator>
      <dc:date>2018-10-24T00:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507052#M17267</link>
      <description>&lt;P&gt;Have you seen &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2012/10/30/violin-plots/#prettyPhoto" target="_self"&gt;this&lt;/A&gt;?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Violin-Plot-with-SQBs-and-MLoc-Markers.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24343iB003CB9F5BB69608/image-size/large?v=v2&amp;amp;px=999" role="button" title="Violin-Plot-with-SQBs-and-MLoc-Markers.png" alt="Violin-Plot-with-SQBs-and-MLoc-Markers.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 02:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507052#M17267</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-24T02:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507163#M17272</link>
      <description>&lt;P&gt;Hi Chris,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wow, thank you for the help! This definitely answers some questions I had re: including IQR and mean/median into my violin plot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand, does anyone else know anything about overlaying boxplots over violin plots? If possible, that would be the most ideal for what I'm looking for...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank again!&lt;/P&gt;&lt;P&gt;Christina&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 14:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507163#M17272</guid>
      <dc:creator>csh2157</dc:creator>
      <dc:date>2018-10-24T14:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507179#M17274</link>
      <description>&lt;P&gt;Do you really want to overlay, i.e. have the box plot on top of the violin plot?&amp;nbsp; That might look messy.&amp;nbsp; Might look cleaner to have a box plot below each violin plot.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rick Wicklin has a post that uses GTL to generate a box plot below a histrogram.&amp;nbsp;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2013/05/08/three-panel-visualization.html&amp;nbsp;" target="_blank"&gt;https://blogs.sas.com/content/iml/2013/05/08/three-panel-visualization.html&amp;nbsp;&lt;/A&gt; Something like that might work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThreePanel2.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24353i153111BE44D60B35/image-size/large?v=v2&amp;amp;px=999" role="button" title="ThreePanel2.png" alt="ThreePanel2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 14:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507179#M17274</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2018-10-24T14:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507197#M17276</link>
      <description>&lt;P&gt;Hi Quentin,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I would ideally like to have the overlay becauase the violin plot, on its own, is a bit too simple for describing my data. However, you bring up a good point about creating the plots separately and presenting them together! I think that this will be a good alternative if I can't figure out how to show on top of each other.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Christina&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 15:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/507197#M17276</guid>
      <dc:creator>csh2157</dc:creator>
      <dc:date>2018-10-24T15:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/892650#M24078</link>
      <description>&lt;P&gt;hello, can I learn about how you deal with this problem that&amp;nbsp;create boxplot overlay on violin plot?&amp;nbsp;&amp;nbsp;I have the same question.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 23:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/892650#M24078</guid>
      <dc:creator>xinlong</dc:creator>
      <dc:date>2023-09-04T23:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create boxplot overlay on violin plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/892762#M24079</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/404332"&gt;@xinlong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hello, can I learn about how you deal with this problem that&amp;nbsp;create boxplot overlay on violin plot?&amp;nbsp;&amp;nbsp;I have the same question.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;On this forum we prefer that you start a new thread and when related to a previous one to provide a link the other thread(s) by copying the url and pasting in you question box.&lt;/P&gt;
&lt;P&gt;That way we can tell where your responses to questions are different from the poster of the original question and readers don't get confused.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a good idea to include some example data in the form of a working data step and what you have so far. Many approaches to graphing rely on the content of a data file and we can't tell what may be needed with your data without an example. Best is also to include the code you have such as your violin plot as a starting point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also Boxplots have a LOT of options. Which features from the box plot do you need?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 15:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-create-boxplot-overlay-on-violin-plot/m-p/892762#M24079</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-05T15:23:23Z</dc:date>
    </item>
  </channel>
</rss>

