<?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 reverse the xaxis values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870735#M343933</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally I've solved it using the negative value and using the tickvaluedisplaylist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to use a format in the proc template, this would be smarter. But I don't know how.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;                        /* surface plot with continuous color ramp */
define statgraph SurfaceTmplt;
dynamic _KMS _AGE _Z _Title;              /* dynamic variables */

 begingraph;
 entrytitle _Title;                   /* specify title at run time (optional) */
  layout overlay3d / tilt=30
          xaxisopts=(label="kms" linearopts=(tickvaluelist=(0 30000 60000 90000 120000 150000 180000 240000 300000 )) )
          yaxisopts=(label="age" linearopts=(tickvaluelist=(-12 -24 -60 -84 -108 -120 )
                                             tickdisplaylist=('12' '24' '60' '84' '108' '120')))
          zaxisopts=(label="sales result" );
      
  
    surfaceplotparm x=_KMS y=_AGE z=_Z /  /* specify variables at run time */

       name="surface" 
       surfacetype=fill
       colormodel=threecolorramp      /* or =twocolorramp */
       colorresponse=_Z 
       reversecolormodel=true;
    continuouslegend "surface";

    
  endlayout;
endgraph;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Apr 2023 09:49:05 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2023-04-20T09:49:05Z</dc:date>
    <item>
      <title>how to reverse the xaxis values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870392#M343782</link>
      <description>&lt;P&gt;I use proc sgrender for a 3D surfaceplot.&lt;/P&gt;
&lt;P&gt;Everything works fine except that the xaxis and yaxis do not meet at their highest values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not find the option to reverse the axis. The x values are multiplied by -1 to achieve the wanted visualization, but the xaxisvalues now show negative values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to trick the code by creating a format to show positive xaxisvalues again.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the context I attach my code, but you cannot use it like this. It should serve to put you in the picture.&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="pic.png" style="width: 730px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82808i0A8A862ED3C883CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc template;                        /* surface plot with continuous color ramp */
define statgraph SurfaceTmplt;
dynamic _KMS _AGE _Z _Title;              /* dynamic variables */

 begingraph;
 entrytitle _Title;                   /* specify title at run time (optional) */
  layout overlay3d / tilt=30
          xaxisopts=(label="kms" linearopts=(tickvaluelist=(0 30000 60000 90000 120000 150000 180000 240000 300000 )) )
          yaxisopts=(label="age" )
          zaxisopts=(label="sales result" );
      
  
    surfaceplotparm x=_KMS y=_AGE z=_Z /  /* specify variables at run time */

       name="surface" 
       surfacetype=fill
       colormodel=threecolorramp      /* or =twocolorramp */
       colorresponse=_Z 
       reversecolormodel=true;
    continuouslegend "surface";

    
  endlayout;
endgraph;
end;
run;

data RISKNOBA.SCORED;
set RISKNOBA.SCORED;
_meses_efectivos=-meses_efectivos;
run;

proc format;
value abs low-high = [abs()];
run;

ods graphics / width=20cm height=20cm  ;    
proc sgrender data=RISKNOBA.SCORED template=SurfaceTmplt; 
where _RMCTMAIMG='6C122V' and byear=2021;
   dynamic _KMS='_o_actual_mileage' _AGE='_meses_efectivos' _Z='P_it_based_sales_res' _Title="3D graph";
format P_it_based_sales_res percent7.0 _meses_efectivos abs.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 15:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870392#M343782</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2023-04-18T15:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to reverse the xaxis values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870397#M343783</link>
      <description>&lt;P&gt;Did you try placing the values in the TICKVALUELIST in reverse order?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 15:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870397#M343783</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-18T15:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to reverse the xaxis values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870735#M343933</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally I've solved it using the negative value and using the tickvaluedisplaylist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to use a format in the proc template, this would be smarter. But I don't know how.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;                        /* surface plot with continuous color ramp */
define statgraph SurfaceTmplt;
dynamic _KMS _AGE _Z _Title;              /* dynamic variables */

 begingraph;
 entrytitle _Title;                   /* specify title at run time (optional) */
  layout overlay3d / tilt=30
          xaxisopts=(label="kms" linearopts=(tickvaluelist=(0 30000 60000 90000 120000 150000 180000 240000 300000 )) )
          yaxisopts=(label="age" linearopts=(tickvaluelist=(-12 -24 -60 -84 -108 -120 )
                                             tickdisplaylist=('12' '24' '60' '84' '108' '120')))
          zaxisopts=(label="sales result" );
      
  
    surfaceplotparm x=_KMS y=_AGE z=_Z /  /* specify variables at run time */

       name="surface" 
       surfacetype=fill
       colormodel=threecolorramp      /* or =twocolorramp */
       colorresponse=_Z 
       reversecolormodel=true;
    continuouslegend "surface";

    
  endlayout;
endgraph;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2023 09:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-reverse-the-xaxis-values/m-p/870735#M343933</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2023-04-20T09:49:05Z</dc:date>
    </item>
  </channel>
</rss>

