<?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: box not plotting with 2 y axes in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958847#M25270</link>
    <description>yes , this works. but wonder why my code which is on the similar lines doesnt work&lt;BR /&gt;</description>
    <pubDate>Mon, 10 Feb 2025 19:04:23 GMT</pubDate>
    <dc:creator>Manj</dc:creator>
    <dc:date>2025-02-10T19:04:23Z</dc:date>
    <item>
      <title>box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958825#M25254</link>
      <description>&lt;P&gt;hi, Im looking for box plot for 3 group variables one with respect to the right handside y axis and other two to the left y axis.My code below doent give any error, but is not giivng any boxes. It creates a graphic area with default legends but not he boxes. what could be the issue/ can anyone help? Thanks&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;&lt;BR /&gt;/*** read in adis and adlb data and combining ***/&lt;/P&gt;&lt;P&gt;proc sort data=analysis.adis(where=( paramcd in ('SAAVTSI') and avisitn&amp;gt;=0 and AVAL ne . )) out=adis(keep= usubjid subjid studyid paramcd param avisit avisitn aval ady rename=(aval=SAAVTSI ady=isdy));&lt;BR /&gt;by studyid usubjid subjid avisitn ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=analysis.adlb(where=( paramcd in ('ALTSI' 'ASTSI') and avisitn&amp;gt;=0 and aval ne . )) out=adlb(keep= usubjid subjid studyid avisit avisitn paramcd param anrhi aval ady rename=(ady=lbdy aval=lbaval));&lt;BR /&gt;by studyid usubjid subjid avisitn ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data ip;&lt;BR /&gt;set adis(in=a) adlb(in=b);&lt;BR /&gt;if lbaval ne . then do;aval1=lbaval/anrhi;end;&lt;BR /&gt;else do;aval2=SAAVTSI;end;&lt;/P&gt;&lt;P&gt;if avisitn=0 then visx=0;&lt;BR /&gt;else visx=input(scan(avisit,2,''),best.);&lt;BR /&gt;/** jitter applies to ALT ***/&lt;BR /&gt;if paramcd='ALTSI' then vis=visx-0.15;&lt;BR /&gt;/** jitter applies to AST ***/&lt;BR /&gt;if paramcd='ASTSI' then vis=visx+0.15;&lt;BR /&gt;/** jitter applies to AAV9 ***/&lt;BR /&gt;if paramcd='SAAVTSI' then vis=visx+0.05;&lt;/P&gt;&lt;P&gt;param2=param;&lt;BR /&gt;param1=param;&lt;/P&gt;&lt;P&gt;/*if paramcd='SAAVTSI' then do;param1=param;param='z';end;&lt;BR /&gt;else do;param1="x";end;*/&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*height=8cm width=22.0cm*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics on / reset=all height=9.5cm width=21.0cm border=off outputfmt=png;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=ip;by paramcd avisitn vis;run;&lt;/P&gt;&lt;P&gt;proc sgplot data=ip dattrmap=myattr;&lt;/P&gt;&lt;P&gt;vbox aval1 / category=vis group=param1 nomean nooutliers whiskerpct=25 connect=median lineattrs=( pattern=1) attrid=param1;&lt;BR /&gt;vbox aval2 / category=vis group=param2 y2axis nomean whiskerpct=25 connect=median ;&lt;/P&gt;&lt;P&gt;yaxis label='AAA value' values=(0 to 3 by 0.5) valueattrs=(size=8);&lt;BR /&gt;y2axis label='ZZZ titer' TYPE=LOG LOGBASE=2 ;*valueattrs=(size=8) values=(&amp;amp;y2vals. ) valuesformat=best. valuesdisplay=(&amp;amp;y2disp. );&lt;BR /&gt;xaxis label='Analysis visit' values=(0,1,2,3,4,6,8,10,12,16,20,24,28,32,36,40,44,48,52 ) valuesdisplay=('Baseline' 'Week 1' 'Week 2' 'Week 3' 'Week 4' 'Week 6' 'Week 8' 'Week 10' 'Week 12' 'Week 16' 'Week 20' 'Week 24' 'Week 28' 'Week 32' 'Week 36' 'Week 40' 'Week 44' 'Week 48' 'Week 52' ) fitpolicy=rotate valuesrotate=diagonal valueattrs=(size=8);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics off;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 17:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958825#M25254</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T17:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958826#M25255</link>
      <description>&lt;P&gt;I noticed the LOG axis request. Are all of the values of "aval2" greater than zero?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 17:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958826#M25255</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2025-02-10T17:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958827#M25256</link>
      <description>Yes&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Feb 2025 17:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958827#M25256</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T17:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958828#M25257</link>
      <description>&lt;P&gt;Are the axes showing values? It might be helpfully to see a image of your output.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 17:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958828#M25257</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2025-02-10T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958829#M25258</link>
      <description>yes. all tick marks, axes label, legends are there.&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Feb 2025 17:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958829#M25258</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T17:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958831#M25259</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Manj_0-1739210342332.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104511i8A79FCE336765ED9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Manj_0-1739210342332.png" alt="Manj_0-1739210342332.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 17:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958831#M25259</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T17:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958832#M25260</link>
      <description>Are there warnings in your log associated with the SGPLOT step?</description>
      <pubDate>Mon, 10 Feb 2025 18:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958832#M25260</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-02-10T18:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958833#M25261</link>
      <description>no warnings</description>
      <pubDate>Mon, 10 Feb 2025 18:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958833#M25261</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T18:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958834#M25262</link>
      <description>And if you run PROC MEANS on 'aval1' and 'aval2', do the distributions match those shown on your two y-axes pretty closely?  &lt;BR /&gt;proc means data=ip min p1 mean p99 max;&lt;BR /&gt;var aval1 aval2;&lt;BR /&gt;run;</description>
      <pubDate>Mon, 10 Feb 2025 18:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958834#M25262</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-02-10T18:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958835#M25263</link>
      <description>&lt;P&gt;indeed i have a line plot with the same data and have given the axes values as per that. but even if I leave the axes values with the default, i dont get the boxes !&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 18:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958835#M25263</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T18:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958836#M25264</link>
      <description>OK, and you also tried it using PARAM as the GROUP variable for both VBOX statements (rather than param1 / param2)?</description>
      <pubDate>Mon, 10 Feb 2025 18:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958836#M25264</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-02-10T18:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958838#M25265</link>
      <description>yes . already tried</description>
      <pubDate>Mon, 10 Feb 2025 18:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958838#M25265</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T18:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958839#M25266</link>
      <description>&lt;P&gt;What version of SAS are you using?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 18:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958839#M25266</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2025-02-10T18:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958840#M25267</link>
      <description>9.4 M7</description>
      <pubDate>Mon, 10 Feb 2025 18:47:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958840#M25267</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T18:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958845#M25268</link>
      <description>&lt;P&gt;I made up this little test at 9.4.m7 and it seems to work. Can you try it and see if it works for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.heart;
vbox cholesterol / category=ageatstart group=weight_status;
vbox cholesterol / category=ageatstart group=weight_status y2axis;
y2axis type=log logbase=2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104513i207C30E4B3E8AF52/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 18:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958845#M25268</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2025-02-10T18:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958846#M25269</link>
      <description>Only other thing I can think of is that the 'jitter' you're applying is causing some sort of issue.  If you remove the jitter, do you get the same problem?  When I test this on fake data, I get warnings in the log saying that not all boxes were drawn if I either apply jitter OR if I specify 2 separate y-axes.  I suspect SGPLOT might not be capable of this particular combination of things.</description>
      <pubDate>Mon, 10 Feb 2025 18:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958846#M25269</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2025-02-10T18:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958847#M25270</link>
      <description>yes , this works. but wonder why my code which is on the similar lines doesnt work&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Feb 2025 19:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958847#M25270</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T19:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958848#M25271</link>
      <description>&lt;P&gt;If you comment out the xaxis statement, do you get boxes?&lt;/P&gt;
&lt;P&gt;If you comment out yaxis statement?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I wonder if the values you entered on the xaxis statement are not the actual values in your dataset.&amp;nbsp; &amp;nbsp;Or if your values are outside the yaxis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing I don't like about SGPLOT vs the much older traditional GPLOT is that SGPLOT does not throw a NOTE when you have data outside of your axes.&amp;nbsp; It's possible all your data is outside the axes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You didn't show your MYATTR dataset.&amp;nbsp; Could it be everything is set to transparent?&lt;BR /&gt;&lt;BR /&gt;I would suggest start with a working plot that is simple, maybe:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=ip ;
  vbox aval1 / category=vis group=param1 nomean nooutliers whiskerpct=25 
  connect=median lineattrs=( pattern=1) attrid=param1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then add back more of your real code incrementally, until the boxes disappear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 19:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958848#M25271</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-02-10T19:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958849#M25272</link>
      <description>&lt;P&gt;Looks like the jitter created the issue. Thank you so much for pointing this.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 19:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958849#M25272</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2025-02-10T19:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: box not plotting with 2 y axes</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958850#M25273</link>
      <description>&lt;P&gt;In the DATA step you manually introduced jitter in the values of VIS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the XAXIS statement you specified the values to be plotted:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;values=(0,1,2,3,4,6,8,10,12,16,20,24,28,32,36,40,44,48,52 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My guess is after you jitter the data, those values don't appear in your data.&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 19:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/box-not-plotting-with-2-y-axes/m-p/958850#M25273</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-02-10T19:11:57Z</dc:date>
    </item>
  </channel>
</rss>

