<?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 control the second y axis tick values interval with layout datalattice? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506935#M17263</link>
    <description>&lt;P&gt;It works now.&amp;nbsp; Thank you very much.&amp;nbsp; I appreciate your help!&lt;/P&gt;</description>
    <pubDate>Tue, 23 Oct 2018 17:28:14 GMT</pubDate>
    <dc:creator>Relax</dc:creator>
    <dc:date>2018-10-23T17:28:14Z</dc:date>
    <item>
      <title>How to control the second y axis tick values interval with layout datalattice?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506871#M17259</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the posted code to create a scatter plot template.&amp;nbsp; I want&amp;nbsp;to use&amp;nbsp;displaysecondary&amp;nbsp;option to change the second y-axis&amp;nbsp;tick values interval like from 0 to 200, but it doesn't work.&amp;nbsp; Is there anything wrong with my code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph scatter3;
begingraph / backgroundcolor=CXD1D0CE border=true borderattrs=(color=CXEDDA74 thickness=5);
entrytitle halign=left textattrs=(size=15pt) "Plot";
entrytitle halign=left textattrs=(size=12pt weight=normal) "Scatter Plot" / opaque=true backgroundcolor=CXFFFFFF;
layout datalattice rowvar=x1 / 
		   headerlabeldisplay=value rowheaders=left
                   rowaxisopts=(griddisplay=on gridattrs=(pattern=dash) display=(ticks tickvalues)
		   linearopts=(viewmin=400 viewmax=1400) displaysecondary=(tickvalues=(0 to 200 by 50))) 
		   columnaxisopts=(griddisplay=on gridattrs=(pattern=dash) labelattrs=(size=12pt weight=normal))
		   headerbackgroundcolor=CXFFFFFF headerlabelattrs=(size=10pt weight=normal);
layout prototype;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 15:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506871#M17259</guid>
      <dc:creator>Relax</dc:creator>
      <dc:date>2018-10-23T15:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the second y axis tick values interval with layout datalattice?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506881#M17260</link>
      <description>&lt;P&gt;Are you looking for ROW2AXISOPTS=(&lt;SPAN class="xis-userSuppliedValue"&gt;axis-options&lt;/SPAN&gt;)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It isn't clear exactly what you are attempting since no actual plot statements are shown or data accompanies the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show your entire code using a SAS supplied data set such as SASHELP.CARS or similar if you don't want to share data.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 15:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506881#M17260</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-23T15:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the second y axis tick values interval with layout datalattice?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506902#M17261</link>
      <description>&lt;P&gt;Thank you for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here attached is my entire code using&amp;nbsp;&lt;SPAN&gt;SAS supplied data set SASHELP.CARS, and the image is the result to run the code.&amp;nbsp; What I attempt to do is to change the interval of the second y-axis, like the axis of Horsepower shown in the scatter plot.&amp;nbsp; The range for Horsepower is from 100 to 500, but I want it to be from 0 to 400.&amp;nbsp; I have tried to&amp;nbsp;use displaysecondary&amp;nbsp;option, but it doesn't work.&amp;nbsp; How could I do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table CARS as
select * 
from sashelp.cars
where Type = "SUV" or Type = "Sedan";
quit;

proc template;
define statgraph scatter;
begingraph / backgroundcolor=CXD1D0CE border=true borderattrs=(color=CXEDDA74 thickness=5);
entrytitle halign=left textattrs=(size=15pt) "Plot";
entrytitle halign=left textattrs=(size=12pt weight=normal) "Scatter Plot" / opaque=true backgroundcolor=CXFFFFFF;
layout datalattice rowvar=Type / 
				   headerlabeldisplay=value rowheaders=left
                   rowaxisopts=(griddisplay=on gridattrs=(pattern=dash) display=(ticks tickvalues))
				   columnaxisopts=(griddisplay=on gridattrs=(pattern=dash) labelattrs=(size=12pt weight=normal))
				   headerbackgroundcolor=CXFFFFFF headerlabelattrs=(size=10pt weight=normal);
layout prototype;
scatterplot x=MPG_City y=Cylinders / markerattrs=(color=CXC11B17 symbol=circlefilled) name='a';
scatterplot x=MPG_City y=EngineSize / markerattrs=(color=CX57E964 symbol=circlefilled)  name='b';
scatterplot x=MPG_City y=Horsepower / yaxis=y2 markerattrs=(color=CX2B65EC symbol=circlefilled)  name='c';
endlayout;
sidebar / align=bottom;
	discretelegend "a" "b" "c"/ border=false valueattrs=(size=11pt);
endsidebar;
endlayout;
endgraph;
end;
run;

proc sgrender data=CARS template=scatter;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24326i14BE71E785A83B0A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 16:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506902#M17261</guid>
      <dc:creator>Relax</dc:creator>
      <dc:date>2018-10-23T16:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the second y axis tick values interval with layout datalattice?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506924#M17262</link>
      <description>&lt;P&gt;See if this can be modified to your need&lt;/P&gt;
&lt;PRE&gt;proc template;
define statgraph scatter;
begingraph / backgroundcolor=CXD1D0CE border=true borderattrs=(color=CXEDDA74 thickness=5);
   entrytitle halign=left textattrs=(size=15pt) "Plot";
   entrytitle halign=left textattrs=(size=12pt weight=normal) "Scatter Plot" / opaque=true backgroundcolor=CXFFFFFF;
   layout datalattice rowvar=Type / 
   				   headerlabeldisplay=value rowheaders=left
                  rowaxisopts=(griddisplay=on gridattrs=(pattern=dash) display=(ticks tickvalues))
   				   columnaxisopts=(griddisplay=on gridattrs=(pattern=dash) labelattrs=(size=12pt weight=normal))
   				   headerbackgroundcolor=CXFFFFFF headerlabelattrs=(size=10pt weight=normal)
                  row2axisopts=(linearopts= (viewmin=0 viewmax=500 tickvaluelist=(0 250 500) ) )
   ;
   layout prototype;
      scatterplot x=MPG_City y=Cylinders / markerattrs=(color=CXC11B17 symbol=circlefilled) name='a';
      scatterplot x=MPG_City y=EngineSize / markerattrs=(color=CX57E964 symbol=circlefilled)  name='b';
      scatterplot x=MPG_City y=Horsepower / yaxis=y2 markerattrs=(color=CX2B65EC symbol=circlefilled)  name='c';
      
   endlayout;
   sidebar / align=bottom;
   	discretelegend "a" "b" "c"/ border=false valueattrs=(size=11pt);
   endsidebar;
   endlayout;
endgraph;
end;
run;

proc sgrender data=CARS template=scatter;
run;&lt;/PRE&gt;
&lt;P&gt;The ROW2AXISOPTS sets the axis appearance options for the second axis, you need the LINEAROPTS=() to set linear axis specific options. The VIEWMIN and VIEWMAX set the range of values and if not present the displayed Y values&amp;nbsp;get truncated (at least on my system)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 16:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506924#M17262</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-23T16:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to control the second y axis tick values interval with layout datalattice?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506935#M17263</link>
      <description>&lt;P&gt;It works now.&amp;nbsp; Thank you very much.&amp;nbsp; I appreciate your help!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 17:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-control-the-second-y-axis-tick-values-interval-with/m-p/506935#M17263</guid>
      <dc:creator>Relax</dc:creator>
      <dc:date>2018-10-23T17:28:14Z</dc:date>
    </item>
  </channel>
</rss>

