<?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 panel by multiple y-axis variables, sgpanel? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/916868#M24382</link>
    <description>&lt;P&gt;You can do this with SGPANEL, but you will need to transform your data a bit. Your three Y axis columns will need to be transposed, such that all Y values are in a single column, with all values in-line with a new column (let's call it "yType") that contains the current Y axis label values ("Total Nitrogen (%)",&amp;nbsp;"Total Carbon (%)", "C:N Ratio"). Then, on the PANELBY statement, set LAYOUT=LATTICE and add the "yType" variable after your "depth" variable. You will also need to set UNISCALE=COLUMN on the PANELBY statement so that each Y axis will be independently scaled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any more questions about this technique.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 21:22:42 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2024-02-19T21:22:42Z</dc:date>
    <item>
      <title>How to panel by multiple y-axis variables, sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/916866#M24381</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am trying to use sgpanel to panel scatter &amp;amp; regerssions plots of various soil parameters (y-variables) agains total carbon (x-axis) by depth (3 depths). I can easily accomodate one y-variale (e.g., total N%, see below). But I'd like to have multiple y-variables (N%, C%, C:N, etc.)... can I do this in sgpanel? If not is there a way to do it in sgplot?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgpanel
	
data=SOCnet_T2_2022
	description=" " noautolegend;
	panelby depth / columns=3;

	styleattrs 
		datacolors=(CX0072B2 CX56B4E9 CX009E73 CXF0E442) 
		datasymbols=(triangle trianglefilled square squarefilled);

	colaxis label="Total Carbon (ton/ac)" labelattrs=(color=black size=12pt weight=bold);
	rowaxis label="Total Nitrogen (%)" labelattrs=(color=black size=12pt weight=bold);

	scatter x=TC_tonac y=N_pct;
	reg x=TC_tonac y=N_pct/cli clm nomarkers;

 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture2.jpg" style="width: 624px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93920i9DFBC07E9819472E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture2.jpg" alt="Picture2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to creat something that looks like this...&amp;nbsp;&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="Picture2.png" style="width: 780px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93921i4331AEA574BE5940/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture2.png" alt="Picture2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 21:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/916866#M24381</guid>
      <dc:creator>grsanford</dc:creator>
      <dc:date>2024-02-19T21:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to panel by multiple y-axis variables, sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/916868#M24382</link>
      <description>&lt;P&gt;You can do this with SGPANEL, but you will need to transform your data a bit. Your three Y axis columns will need to be transposed, such that all Y values are in a single column, with all values in-line with a new column (let's call it "yType") that contains the current Y axis label values ("Total Nitrogen (%)",&amp;nbsp;"Total Carbon (%)", "C:N Ratio"). Then, on the PANELBY statement, set LAYOUT=LATTICE and add the "yType" variable after your "depth" variable. You will also need to set UNISCALE=COLUMN on the PANELBY statement so that each Y axis will be independently scaled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any more questions about this technique.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 21:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/916868#M24382</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-02-19T21:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to panel by multiple y-axis variables, sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/917009#M24386</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130" target="_self"&gt;DanH&lt;/A&gt;, this is fantastic and worked great (see below). I have two follow up questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Is it possible to custom format the row/column headers? For example. I'd like to remove detph= from the columns, and change the rows to C %, Bulk Density (g/cc), and OM %. The only way I've thought to do this is supress them entirely and use an annotate dataset...&lt;/P&gt;&lt;P&gt;2. Is it possible to have 3 distinct y-axis labels on the left side of the graph as oppose to the column headers at the right?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your help with this. Code and image below.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture1.jpg" style="width: 720px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93945i52D3FF2AAB440C9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture1.jpg" alt="Picture1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgpanel
	data=C_2022
	description=" " noautolegend;
	panelby depth resp / columns=3 layout=lattice uniscale=column;

	styleattrs 
		datacolors=(CX0072B2 CX56B4E9 CX009E73 CXF0E442) 
		datasymbols=(triangle trianglefilled square squarefilled);

	scatter x=TC_tonac y=COL1/group=order;
	reg x=TC_tonac y=COL1 / nomarkers degree=1;

	rowaxis label="  ";
	colaxis label="Total Carbon (ton/ac)" labelattrs=(color=black size=12pt weight=bold);

	keylegend / title="Soil Orders" exclude=('95% Confidence Limits' '95% Prediction Limits' 'Regression') noborder ;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Feb 2024 17:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/917009#M24386</guid>
      <dc:creator>grsanford</dc:creator>
      <dc:date>2024-02-20T17:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to panel by multiple y-axis variables, sgpanel?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/917045#M24389</link>
      <description>&lt;P&gt;For #1, use the NOVARNAME option on the PANELBY statement to drop the left-side labels (e.g. depth=). For your custom row values, create a user-defined format and set it on the SGPANEL procedure using the FORMAT statement: FORMAT resp myfmt.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For #2, set ROWHEADERPOS=LEFT on the PANELBY statement. You might also want to set NOHEADERBORDER and HEADERBACKCOLOR to make the labels appear more like axis labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 19:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-panel-by-multiple-y-axis-variables-sgpanel/m-p/917045#M24389</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-02-20T19:18:53Z</dc:date>
    </item>
  </channel>
</rss>

