<?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: X axis labeling with two variables sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413682#M14202</link>
    <description>&lt;P&gt;For any graph questions its best to look here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, as there is examples of anything graph orientated with code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here for instance is one showing data below the graph:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/08/08/tips-and-tricks-transparent-margins/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2017/08/08/tips-and-tricks-transparent-margins/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may just not draw the X on the first graph, draw the second under it and put the X axis for that one.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 15:22:34 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-15T15:22:34Z</dc:date>
    <item>
      <title>X axis labeling with two variables sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413669#M14200</link>
      <description>&lt;P&gt;Hi, I would like to add a second vbar so the graph shows the region at the bottom as well as the village by the x axis&lt;/P&gt;&lt;P&gt;like in the excel graph attached. Thank you in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jef_mto variable is 'J.A.MTO.BARCELONA' , &lt;SPAN&gt;J.A.MTO.ZARAGOZA' ,J.A.MTO.TARRAGONA'&amp;nbsp;&lt;/SPAN&gt;in the graph.&lt;/P&gt;&lt;P&gt;vbar = Garraf, Castelldefells,Balenya-Tona-Seva etc&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc sgplot data=peores_all dattrmap=attrmap;
    vbar  denominacion_estacion  / response=Tasa_fallo  group=mes  grouporder=descending stat=sum attrid=myid ;
	/*styleattrs datacolors=(red brown orange yellow darkgreen green lightgreen);*/

   xaxis label='estacion' discreteorder=data 
labelattrs=( size=7pt )
    valueattrs=( size=7pt )
	fitpolicy=rotate
	valuesrotate=vertical;
   yaxis label='';
   
   title '';
   keyLegend / title='Mes';
   by subdireccion  jef_mto tipo_cv  /*I would like to move jef_mto variable so the graphs look like the attached*/
	
;
    run; quit;

	ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PHOTO GRAPH.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16656i4C559524F1954304/image-size/large?v=v2&amp;amp;px=999" role="button" title="PHOTO GRAPH.png" alt="PHOTO GRAPH.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413669#M14200</guid>
      <dc:creator>vanmon1</dc:creator>
      <dc:date>2017-11-15T14:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: X axis labeling with two variables sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413682#M14202</link>
      <description>&lt;P&gt;For any graph questions its best to look here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, as there is examples of anything graph orientated with code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here for instance is one showing data below the graph:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/08/08/tips-and-tricks-transparent-margins/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2017/08/08/tips-and-tricks-transparent-margins/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may just not draw the X on the first graph, draw the second under it and put the X axis for that one.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 15:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413682#M14202</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-15T15:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: X axis labeling with two variables sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413698#M14205</link>
      <description>&lt;P&gt;For this case, I suggest using SGPANEL with region as the panel variable in the PANELBY statement with the PROPORTIONAL option .&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 15:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413698#M14205</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-11-15T15:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: X axis labeling with two variables sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413918#M14224</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Excel" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16665iB35B89FF5ED71411/image-size/large?v=v2&amp;amp;px=999" role="button" title="excel.png" alt="Excel" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Excel&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPANEL" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16667i176BD85A914CFBB8/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel28.png" alt="SGPANEL" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;SGPANEL&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="My SGPLOT with missing region" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16666iEF7C91AB6CE161B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot730.png" alt="My SGPLOT with missing region" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;My SGPLOT with missing region&lt;/span&gt;&lt;/span&gt;Sanjay_SAS, thank you for your reply. I don't know much about ods graphics. I see the sgpanel may help me but then I loose all the other settings. Please see attachemnts with sgplot and sgpanel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have three levels of data Subdireccion (like State), Jef_mto (like region) and the vbar denominacion_estacion (like village).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to show in one by the State, the villages divided by their region. And also, keep the order of the response by the group=mes (month) . Sgpanel mixes the states when the number of regions is an odd number (attached).&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*proc sgpanel*/
	proc sgpanel data=peores_all dattrmap=attrmap;
	panelby subdireccion jef_mto tipo_cv;
	rowaxis label="estación";
	vbar denominacion_estacion /response=Tasa_fallo group=mes  grouporder=descending stat=sum attrid=myid ;
	
	run;



/*sgplot*/

ods pdf file="\\tsclient\C\Transferencia de Archivos\EXPORTED FINAL TABLE\'Peores jefaturas CVs.pdf";

ODS GRAPHICS/ WIDTH=20.32CM ;
data attrmap;
retain id "myid";
input value $ fillcolor $;
datalines;

2017-10 red 
2017-09 brown 
2017-08 orange 
2017-07 yellow 
2017-06 big 
2017-05 bilg 
2017-04 bigy
2017-03 bigy
2017-02 grey
2017-01 grey
2016-12 grey
2016-11 grey
2016-10 grey
2016-09 grey
2016-08 grey
2016-07 grey
2016-06 grey
2016-05 grey
2016-04 grey
2016-03 grey
2016-02 grey
2016-01 grey
2015-12 grey
2015-11 grey
2015-10 grey
2015-09 grey
2015-08 grey
2015-07 grey
2015-06 grey
2015-05 grey
2015-04 grey
2015-03 grey
2015-02 grey
2015-01 grey
run;





proc sgplot data=peores_all dattrmap=attrmap;
    vbar  denominacion_estacion / response=Tasa_fallo  group=mes  grouporder=descending stat=sum attrid=myid ;
	/*styleattrs datacolors=(red brown orange yellow darkgreen green lightgreen);*/

   xaxis label='estacion' discreteorder=data 
labelattrs=( size=7pt )
    valueattrs=( size=7pt )
	fitpolicy=rotate
	valuesrotate=vertical;
   yaxis label='';
   
   title '';
   keyLegend / title='Mes';
   by subdireccion  tipo_cv 
	
;
    run; quit;

	ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;region. Like in the excel.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPanel28.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16664iF6EE011E1EE80EA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel28.png" alt="SGPanel28.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot730.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16663i1AC8DA698FB86BD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot730.png" alt="SGPlot730.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 07:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/413918#M14224</guid>
      <dc:creator>vanmon1</dc:creator>
      <dc:date>2017-11-16T07:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: X axis labeling with two variables sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/414039#M14225</link>
      <description>&lt;P&gt;Clearly, you have too many categories per cell which results in many diagonal tick values.&amp;nbsp; If you attach your full program and sample data (not your confidential data), it will be easier to help.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 15:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/414039#M14225</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-11-16T15:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: X axis labeling with two variables sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/414101#M14226</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample using sashelp.prdsale.&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="Vanmon1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16680i5254C6FDB5A284E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vanmon1.png" alt="Vanmon1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data prdsale;&lt;BR /&gt; set sashelp.prdsale;&lt;BR /&gt; if ~(country='GERMANY' and (product="BED" or product="CHAIR"));&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods html close;&lt;BR /&gt;ods listing gpath='C:\Work\SASUser\Communities\Image' image_dpi=200;&lt;BR /&gt;ods graphics / reset width=6in height=4in imagename='Vanmon1';&lt;BR /&gt;proc sgpanel data=prdsale ;&lt;BR /&gt;&amp;nbsp; by year;&lt;BR /&gt;&amp;nbsp; panelby country / onepanel layout=columnlattice colheaderpos=bottom &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;noheaderborder novarname noborder proportional uniscale=row spacing=20;&lt;BR /&gt;&amp;nbsp; vbar product / stat=sum group=month response=actual displaybaseline=auto &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;barwidth=0.5 dataskin=pressed;&lt;BR /&gt;&amp;nbsp; colaxis fitpolicy=rotate valuesrotate=vertical display=(nolabel noticks noline);&lt;BR /&gt;&amp;nbsp; rowaxis display=(nolabel noticks noline) grid;&lt;BR /&gt;&amp;nbsp; keylegend / across=6 title='';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 18:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/X-axis-labeling-with-two-variables-sgplot/m-p/414101#M14226</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-11-16T18:43:14Z</dc:date>
    </item>
  </channel>
</rss>

