<?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 draw box plot with nonlinear axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398823#M13660</link>
    <description>&lt;P&gt;I'm not sure if this is sufficient for your data but you can use a format for the x axis variable to make a log axis "lie to you" and show a 0.&lt;/P&gt;
&lt;PRE&gt;data junk;
   do PlotGroup='Group 1','Group 2';
      do loop = 1 to 5;
         x = rand('uniform') * 10**loop;
         output;
      end;
   end;
run;
proc format library=work;
value logx 1=0
other=[best6.];
run;
proc sgplot data=junk;
   hbox x/category= PlotGroup;
   xaxis type=log logbase=10 logstyle=linear
        
   ;
   format x logx.;

run;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Sep 2017 14:45:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-09-26T14:45:09Z</dc:date>
    <item>
      <title>How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398798#M13647</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to draw a box plot that looks like the photo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the data, but not sure what codes to use. I think the x-axis is non-linear too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyone who can give me an example code that would match the photo as much as possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume it may go something like....&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc boxplot data=have;
plot data*group;
run;

proc sgplot data=have;
hbox data / category=group;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KakaoTalk_20170926_041924119.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15421i1A7D8C5A5AE24BEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="KakaoTalk_20170926_041924119.jpg" alt="KakaoTalk_20170926_041924119.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398798#M13647</guid>
      <dc:creator>Dani08</dc:creator>
      <dc:date>2017-09-26T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398803#M13650</link>
      <description>&lt;P&gt;You can set the x-axis to log.&amp;nbsp; However, all data must be &amp;gt; 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=sashelp.class;&lt;BR /&gt;&amp;nbsp; hbox height / category=sex;&lt;BR /&gt;&amp;nbsp; xaxis type=log min=1 logbase=2;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 13:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398803#M13650</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-09-26T13:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398804#M13651</link>
      <description>&lt;P&gt;Thank you, but is there no other way to include the 0?&lt;/P&gt;&lt;P&gt;Lots of the data are 0, so I'd be losing lots of data, and the distribution will look different...&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398804#M13651</guid>
      <dc:creator>Dani08</dc:creator>
      <dc:date>2017-09-26T14:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398807#M13653</link>
      <description>&lt;P&gt;It's impossible. You can't plot the log of zero because it doesn't exist. Maybe you'd like some other non-linear axis, but I don't think SAS can do that.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398807#M13653</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-09-26T14:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398813#M13656</link>
      <description>&lt;P&gt;Mathematically, you cannot have values &amp;lt; 0 on a log axis.&amp;nbsp; Such values are undefined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have data with values &amp;lt;= 0, then you will need to remove these from the data before using the data in the procedure.&amp;nbsp; You can set the x-axis min value to some small value (&amp;gt; 0), but the shape of the graph will change based on the min value you choose, whether it is 0.1, or 0.0001.&amp;nbsp; While I do not recommend this, you can replace the lowest value with "0", but that seems wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398813#M13656</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-09-26T14:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398815#M13657</link>
      <description>&lt;P&gt;As Paige suggests, you could define your own transform, and transform the data yourself before using the SGPLOT procedure.&amp;nbsp; You can certainly "customize" the values displayed on the x-axis back to the untransformed values using the VALUES and VALUESDISPLAY options.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398815#M13657</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-09-26T14:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398817#M13658</link>
      <description>&lt;P&gt;Hi Paigemiller and Sanjay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. I think what I'll do is try create a panel of histograms to compare the distributions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whilst Sanjay's suggestion is tempting, zero number of amino acids means 0, rather than 0.0001, so I don't think it's an option for this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you both for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398817#M13658</guid>
      <dc:creator>Dani08</dc:creator>
      <dc:date>2017-09-26T14:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to draw box plot with nonlinear axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398823#M13660</link>
      <description>&lt;P&gt;I'm not sure if this is sufficient for your data but you can use a format for the x axis variable to make a log axis "lie to you" and show a 0.&lt;/P&gt;
&lt;PRE&gt;data junk;
   do PlotGroup='Group 1','Group 2';
      do loop = 1 to 5;
         x = rand('uniform') * 10**loop;
         output;
      end;
   end;
run;
proc format library=work;
value logx 1=0
other=[best6.];
run;
proc sgplot data=junk;
   hbox x/category= PlotGroup;
   xaxis type=log logbase=10 logstyle=linear
        
   ;
   format x logx.;

run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:45:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-draw-box-plot-with-nonlinear-axis/m-p/398823#M13660</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-26T14:45:09Z</dc:date>
    </item>
  </channel>
</rss>

