<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, violinplot procedure</title>
    <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 14:10:24 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 14:10:24 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, violinplot procedure</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, violinplot procedure</title>
      <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure</link>
    </image>
    <item>
      <title>Isn't tipping and capping automatic?</title>
      <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure?ref=Feed:MaplePrimes:violinplot procedure:Comments#answer143660</link>
      <itunes:summary>&lt;p&gt;It seems to me that the tipping and capping will come automatically if you simply apply your procedure &lt;strong&gt;violinplot&lt;/strong&gt; to a &lt;strong&gt;KernelDensityPlot &lt;/strong&gt;with the ranging options. In particular, to enforce positivity, in the below example I use the &lt;strong&gt;left= 0 &lt;/strong&gt;option.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;violinplot:= proc()&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; local P;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; P:= Statistics:-KernelDensityPlot(args);&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; plots:-display(&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plottools:-rotate(&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plots:-display(P, plottools:-reflect(P, [[0,0], [1,0]]))&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Pi/2&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; )&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;end proc:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;violinplot([45,7,4,345,8,456,3,2,45,444,111,34], left= 0, axes= boxed);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="/view.aspx?sf=143660/454229/violinplot.gif"&gt;&lt;img src="/view.aspx?sf=143660/454229/violinplot.gif" alt=""&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Isn't this plot tipped and capped as you want?&lt;strong&gt;&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;It seems to me that the tipping and capping will come automatically if you simply apply your procedure &lt;strong&gt;violinplot&lt;/strong&gt; to a &lt;strong&gt;KernelDensityPlot &lt;/strong&gt;with the ranging options. In particular, to enforce positivity, in the below example I use the &lt;strong&gt;left= 0 &lt;/strong&gt;option.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;violinplot:= proc()&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; local P;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; P:= Statistics:-KernelDensityPlot(args);&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; plots:-display(&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plottools:-rotate(&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; plots:-display(P, plottools:-reflect(P, [[0,0], [1,0]]))&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Pi/2&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; )&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;end proc:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;violinplot([45,7,4,345,8,456,3,2,45,444,111,34], left= 0, axes= boxed);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="/view.aspx?sf=143660/454229/violinplot.gif"&gt;&lt;img src="/view.aspx?sf=143660/454229/violinplot.gif" alt=""&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Isn't this plot tipped and capped as you want?&lt;strong&gt;&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;</description>
      <guid>143660</guid>
      <pubDate>Tue, 19 Feb 2013 22:04:02 Z</pubDate>
      <itunes:author>Carl Love</itunes:author>
      <author>Carl Love</author>
    </item>
    <item>
      <title>range is better and bee swarm plot</title>
      <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure?ref=Feed:MaplePrimes:violinplot procedure:Comments#answer143685</link>
      <itunes:summary>&lt;p&gt;Actually using left and right distorts the distribution too much.&amp;nbsp; Using range makes it better. You were right with the caps.&amp;nbsp; The whiskers for the tips, yes I would want to reach min and max points without going over, however I think that offsets the data too much.&amp;nbsp; &lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Actually using left and right distorts the distribution too much.&amp;nbsp; Using range makes it better. You were right with the caps.&amp;nbsp; The whiskers for the tips, yes I would want to reach min and max points without going over, however I think that offsets the data too much.&amp;nbsp; &lt;/p&gt;</description>
      <guid>143685</guid>
      <pubDate>Wed, 20 Feb 2013 03:32:17 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>with range</title>
      <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure?ref=Feed:MaplePrimes:violinplot procedure:Comments#answer143691</link>
      <itunes:summary>&lt;p&gt;Using range we need to close the ends.&amp;nbsp; Here's the updated proc for that.&amp;nbsp; Sorry I haven't elaborated on the bee swarm plot but basically I think that is data jittered inside a violin plot.&amp;nbsp; Also using method=exact speeds up the production of the plot.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;form name="worksheet_form"&gt;
&lt;table style="width: 576px;" align="center"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -230;" src="/view.aspx?sf=143691/454287/424e382d9892520283946f84ad5f21f0.gif" alt="violinplot := proc (data) local a, b, c, caps, lc, rc; a := Statistics:-KernelDensityPlot(data, range = min(data) .. max(data), color = blue, method = exact); b := plottools:-reflect(a, [[0, 0], [1, 0]]); lc := Statistics:-KernelDensity(data, eval = min(data)); rc := Statistics:-KernelDensity(data, eval = max(data)); caps := plot({[[max(data), rc], [max(data), -rc]], [[min(data), lc], [min(data), -lc]]}, color = blue); c := plots:-display(a, b, caps, axes = box, color = blue); plots:-display(plottools:-rotate(c, (1/2)*Pi)) end proc:" width="576" height="247" align="middle"&gt;&lt;/p&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/bcf8f28a5a476086bd3ce041aecb21da.gif" alt="b := [45, 7, 4, 345, 8, 456, 3, 2, 45, 444, 111, 34]" width="418" height="23"&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="center"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/a2129cf85b2606b840cfd94ea107a7a8.gif" alt="[45, 7, 4, 345, 8, 456, 3, 2, 45, 444, 111, 34]" width="297" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="color: #000000; font-family: Times, serif; font-weight: bold; font-style: normal;" align="right"&gt;(1)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/1c66738159b8f029bdffafd8ecd90830.gif" alt="violinplot(b)" width="84" height="23"&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="center"&gt;&lt;a href="http://www.maplesoft.com/support/faqs/MapleNet/redirect.aspx?param=plot_java_14206"&gt;&lt;img style="border: none;" src="/view.aspx?sf=143691/454287/7432c3aeeb42bac49307f3a68b4b637d.gif" alt="" width="400" height="400" align="middle"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="color: #000000; font-family: Times, serif; font-weight: bold; font-style: normal;" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/a170e0002768d467eff142e4d600f35d.gif" alt="``" width="11" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;input type="hidden" name="sequence" value="1"&gt; &lt;input type="hidden" name="cmd" value="none"&gt;&lt;/form&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=143691/454287/violinplot_proc_4.mw"&gt;Download violinplot_proc_4.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;**edit** adding bandwidth=nops(data)*2 gives a little more flavour to the plot and a better indication of where the data points are.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=143691/454316/violin2.jpeg"&gt;&lt;img src="/view.aspx?sf=143691/454316/violin2.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Using range we need to close the ends.&amp;nbsp; Here's the updated proc for that.&amp;nbsp; Sorry I haven't elaborated on the bee swarm plot but basically I think that is data jittered inside a violin plot.&amp;nbsp; Also using method=exact speeds up the production of the plot.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;form name="worksheet_form"&gt;
&lt;table style="width: 576px;" align="center"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -230;" src="/view.aspx?sf=143691/454287/424e382d9892520283946f84ad5f21f0.gif" alt="violinplot := proc (data) local a, b, c, caps, lc, rc; a := Statistics:-KernelDensityPlot(data, range = min(data) .. max(data), color = blue, method = exact); b := plottools:-reflect(a, [[0, 0], [1, 0]]); lc := Statistics:-KernelDensity(data, eval = min(data)); rc := Statistics:-KernelDensity(data, eval = max(data)); caps := plot({[[max(data), rc], [max(data), -rc]], [[min(data), lc], [min(data), -lc]]}, color = blue); c := plots:-display(a, b, caps, axes = box, color = blue); plots:-display(plottools:-rotate(c, (1/2)*Pi)) end proc:" width="576" height="247" align="middle"&gt;&lt;/p&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/bcf8f28a5a476086bd3ce041aecb21da.gif" alt="b := [45, 7, 4, 345, 8, 456, 3, 2, 45, 444, 111, 34]" width="418" height="23"&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="center"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/a2129cf85b2606b840cfd94ea107a7a8.gif" alt="[45, 7, 4, 345, 8, 456, 3, 2, 45, 444, 111, 34]" width="297" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="color: #000000; font-family: Times, serif; font-weight: bold; font-style: normal;" align="right"&gt;(1)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/1c66738159b8f029bdffafd8ecd90830.gif" alt="violinplot(b)" width="84" height="23"&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr valign="baseline"&gt;
&lt;td&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="center"&gt;&lt;a href="http://www.maplesoft.com/support/faqs/MapleNet/redirect.aspx?param=plot_java_14206"&gt;&lt;img style="border: none;" src="/view.aspx?sf=143691/454287/7432c3aeeb42bac49307f3a68b4b637d.gif" alt="" width="400" height="400" align="middle"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td style="color: #000000; font-family: Times, serif; font-weight: bold; font-style: normal;" align="right"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="margin: 0 0 0 0; padding-top: 0px; padding-bottom: 0px;" align="left"&gt;&lt;img style="vertical-align: -6;" src="/view.aspx?sf=143691/454287/a170e0002768d467eff142e4d600f35d.gif" alt="``" width="11" height="23"&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;input type="hidden" name="sequence" value="1"&gt; &lt;input type="hidden" name="cmd" value="none"&gt;&lt;/form&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=143691/454287/violinplot_proc_4.mw"&gt;Download violinplot_proc_4.mw&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;**edit** adding bandwidth=nops(data)*2 gives a little more flavour to the plot and a better indication of where the data points are.&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=143691/454316/violin2.jpeg"&gt;&lt;img src="/view.aspx?sf=143691/454316/violin2.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <guid>143691</guid>
      <pubDate>Wed, 20 Feb 2013 06:09:12 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>capped yes</title>
      <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure?ref=Feed:MaplePrimes:violinplot procedure:Comments#comment143663</link>
      <itunes:summary>&lt;p&gt;Yes, okay adding the left=min(data),right=max(data) is what I wanted for capping.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding tipped, what I mean is shrinking the scale of the kerneldensityplot (no specified range) so that the plot ends on the upper and lower bounds of the data. &lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Yes, okay adding the left=min(data),right=max(data) is what I wanted for capping.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding tipped, what I mean is shrinking the scale of the kerneldensityplot (no specified range) so that the plot ends on the upper and lower bounds of the data. &lt;/p&gt;</description>
      <guid>143663</guid>
      <pubDate>Tue, 19 Feb 2013 23:06:18 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>Placement of cusps</title>
      <link>http://www.mapleprimes.com/questions/143652-Violinplot-Procedure?ref=Feed:MaplePrimes:violinplot procedure:Comments#comment143670</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/143652-Violinplot-Procedure#comment143663"&gt;@Christopher2222&lt;/a&gt; Ah, I guess by "caps" you meant what are called "whiskers" in a box-and-whiskers plot, the central vertical lines? Those are what I thought you meant by "tips". And I thought that by "caps" you meant what appears as horizontal lines in my plot.&lt;/p&gt;
&lt;p&gt;So now I am guessing that you want the violin to have a cusp at the top and bottom, as in your original plot, with the top cusp at the highest data point and the bottom cusp at the lowest data point. Is that right? I believe we can achieve this with &lt;strong&gt;plottools:-homothety&lt;/strong&gt;. And I guess that you want the scale of the vertical axis to stay the same. Is that correct?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/143652-Violinplot-Procedure#comment143663"&gt;@Christopher2222&lt;/a&gt; Ah, I guess by "caps" you meant what are called "whiskers" in a box-and-whiskers plot, the central vertical lines? Those are what I thought you meant by "tips". And I thought that by "caps" you meant what appears as horizontal lines in my plot.&lt;/p&gt;
&lt;p&gt;So now I am guessing that you want the violin to have a cusp at the top and bottom, as in your original plot, with the top cusp at the highest data point and the bottom cusp at the lowest data point. Is that right? I believe we can achieve this with &lt;strong&gt;plottools:-homothety&lt;/strong&gt;. And I guess that you want the scale of the vertical axis to stay the same. Is that correct?&lt;/p&gt;</description>
      <guid>143670</guid>
      <pubDate>Wed, 20 Feb 2013 00:37:38 Z</pubDate>
      <itunes:author>Carl Love</itunes:author>
      <author>Carl Love</author>
    </item>
  </channel>
</rss>