<?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: Changing X and Y axis value automatically Bubble chart in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608864#M76678</link>
    <description>&lt;P&gt;This will be helpful.&lt;/P&gt;&lt;P&gt;Can we also plot a line chart for average weight and height in the same visual?&lt;/P&gt;&lt;P&gt;In that way we can say who is above and below the average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;+Sathyan&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2019 21:25:44 GMT</pubDate>
    <dc:creator>skallamp1</dc:creator>
    <dc:date>2019-12-02T21:25:44Z</dc:date>
    <item>
      <title>Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608843#M76670</link>
      <description>&lt;P&gt;Is there a way to automatically asks SAS to pick the minimum and maximum value for y and x axis as shown below?&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will make the code flexible to handle any different data and zoom the view as the data range keeps changing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=sashelp.class(where=(sex='F')) noautolegend;&lt;BR /&gt;bubble x=height y=weight size=age / group=name datalabel=name&lt;BR /&gt;transparency=0.4 datalabelattrs=(size=9 weight=bold);&lt;BR /&gt;inset "Bubble size represents Age" / position=bottomright textattrs=(size=11);&lt;BR /&gt;yaxis &lt;U&gt;grid&lt;/U&gt;; **** How to take the min and max instead of just giving grid? something like this "&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;yaxis min = min(grid) max = max(grid) offsetmin=0 offsetmax=0.1 display=(nolabel) grid;&lt;/STRONG&gt;&lt;/FONT&gt;" *****;&lt;BR /&gt;xaxis &lt;U&gt;grid&lt;/U&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 20:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608843#M76670</guid>
      <dc:creator>skallamp1</dc:creator>
      <dc:date>2019-12-02T20:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608848#M76671</link>
      <description>&lt;P&gt;What values would min(grid) and max(grid) be?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608848#M76671</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-12-02T21:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608857#M76674</link>
      <description>&lt;P&gt;If you want to scale the axis for the full data set, while filtering what you plot (as in your example with sex='F'), you can store the min/max in macro variables and use as the MIN/MAX= values.&amp;nbsp; Is that what you're after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
 select min(weight) into: min from sashelp.class;
 select max(weight) into: max from sashelp.class;
quit;

proc sgplot data=sashelp.class(where=(sex='F')) noautolegend;
bubble x=height y=weight size=age / group=name datalabel=name
transparency=0.4 datalabelattrs=(size=9 weight=bold);
inset "Bubble size represents Age" / position=bottomright textattrs=(size=11);
yaxis grid min=&amp;amp;min. max=&amp;amp;max.; 
xaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bbl.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34389i362620962ABB9E99/image-size/large?v=v2&amp;amp;px=999" role="button" title="bbl.jpg" alt="bbl.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608857#M76674</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-12-02T21:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608859#M76675</link>
      <description>&lt;P&gt;xaxis min= min(height) max= max(height) offsetmin=0 offsetmax=0.1 display=(nolabel) grid;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should pick the min and max values from x and y axis.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608859#M76675</guid>
      <dc:creator>skallamp1</dc:creator>
      <dc:date>2019-12-02T21:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608861#M76676</link>
      <description>What happens if you don't specify them at all? Wouldn't SAS adjust it automatically to what you had wanted?</description>
      <pubDate>Mon, 02 Dec 2019 21:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608861#M76676</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-02T21:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608864#M76678</link>
      <description>&lt;P&gt;This will be helpful.&lt;/P&gt;&lt;P&gt;Can we also plot a line chart for average weight and height in the same visual?&lt;/P&gt;&lt;P&gt;In that way we can say who is above and below the average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;+Sathyan&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608864#M76678</guid>
      <dc:creator>skallamp1</dc:creator>
      <dc:date>2019-12-02T21:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608885#M76688</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/297190"&gt;@skallamp1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This will be helpful.&lt;/P&gt;
&lt;P&gt;Can we also plot a line chart for average weight and height in the same visual?&lt;/P&gt;
&lt;P&gt;In that way we can say who is above and below the average.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;+Sathyan&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try adding a reg plot:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class(where=(sex='F')) noautolegend;
   bubble x=height y=weight size=age / group=name datalabel=name
   transparency=0.4 datalabelattrs=(size=9 weight=bold);

   reg x=height y=weight;

   inset "Bubble size represents Age" / position=bottomright textattrs=(size=11);
   yaxis grid ; 
   xaxis grid;
run;&lt;/PRE&gt;
&lt;P&gt;Default is a linear regression which would be , given the data , the mean Y for X. Though how good the fit may be...&lt;/P&gt;
&lt;P&gt;Which is why the Reg plot may include confidence limits for&amp;nbsp; either the mean or the individual values.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 22:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/608885#M76688</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-02T22:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Changing X and Y axis value automatically Bubble chart</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/609107#M76709</link>
      <description>&lt;P&gt;I like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;'s idea because I think that is probably more meaningful -- fitting a line to a model and providing a simple visual to show the distance of each point to that line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you just want true averages, a variation of what I shared earlier:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
 select avg(weight) into: avgW from sashelp.class(where=(sex='F')) ;
 select avg(height) into: avgH from sashelp.class(where=(sex='F')) ;
quit;

proc sgplot data=sashelp.class(where=(sex='F')) noautolegend;
   bubble x=height y=weight size=age / group=name datalabel=name
   transparency=0.4 datalabelattrs=(size=9 weight=bold);

   refline &amp;amp;avgW. / axis=y label="Avg weight=&amp;amp;avgW." 
        labelloc=inside 
        lineattrs=(pattern=dot thickness=2)
        labelpos=min;

   refline &amp;amp;avgH. / axis=x label="Avg height=&amp;amp;avgH." 
        labelloc=inside 
        lineattrs=(pattern=dot thickness=2)
        labelpos=max;

   inset "Bubble size represents Age" / position=bottomright textattrs=(size=11);
   yaxis grid ; 
   xaxis grid;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="avg.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34409i3BDC64293212956A/image-size/large?v=v2&amp;amp;px=999" role="button" title="avg.jpg" alt="avg.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 16:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Changing-X-and-Y-axis-value-automatically-Bubble-chart/m-p/609107#M76709</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-12-03T16:05:00Z</dc:date>
    </item>
  </channel>
</rss>

