<?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 Conditional tickvalueattrs in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/860701#M23530</link>
    <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I need to find a way to assign a font color to the Y axis ticks, depending on whether or not the Y value is within a predefined list of values.&lt;/P&gt;&lt;P&gt;The template (which works perfectly) that I must modify to achieve what is requested is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
 define statgraph contourplotparm;
   begingraph;
     entrytitle "&amp;amp;var Ciclo &amp;amp;ciclo";
     layout overlay /
 	
	 yaxisopts=( offsetmin=0.01 offsetmax=0.01 tickvalueattrs=(size=5pt )
			linearopts=(tickvaluesequence=(start=1 end=&amp;amp;nvarie
			increment=1) viewmin=1 viewmax=&amp;amp;nvarie			
			tickdisplaylist=(&amp;amp;ylist)))

	xaxisopts=( offsetmin=0.01 offsetmax=0.01 tickvalueattrs=(size=6pt)
			linearopts=(tickvaluesequence=(start=&amp;amp;mn_edad end=&amp;amp;mx_edad
			increment=1) viewmin=&amp;amp;mn_edad viewmax=&amp;amp;mx_edad
			tickvaluefitpolicy = rotatealways
			/*tickvaluerotation=0*/
			tickdisplaylist=(&amp;amp;xlist))) 
	;
contourplotparm x=edad y=orden z=&amp;amp;var /
         contourtype=fill nhint=7 
           name="Contour" colormodel=&amp;amp;m_cmodel;
       continuouslegend "Contour" /  title= "&amp;amp;var" ;

referenceline y=10.5 / lineattrs=(thickness=1 color=black pattern=dash); 
referenceline y=%sysevalf(&amp;amp;lbm-0.5) / lineattrs=(thickness=1 color=black pattern= dot ); 
referenceline y=%sysevalf(&amp;amp;ubm+0.5) / lineattrs=(thickness=1 color=black pattern=dot);
referenceline y=%sysevalf(&amp;amp;lba-0.5) / lineattrs=(thickness=1 color=black pattern=dash);  
endlayout;
   endgraph;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I appreciate your help&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2023 17:07:11 GMT</pubDate>
    <dc:creator>jfgiraldo</dc:creator>
    <dc:date>2023-02-24T17:07:11Z</dc:date>
    <item>
      <title>Conditional tickvalueattrs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/860701#M23530</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I need to find a way to assign a font color to the Y axis ticks, depending on whether or not the Y value is within a predefined list of values.&lt;/P&gt;&lt;P&gt;The template (which works perfectly) that I must modify to achieve what is requested is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
 define statgraph contourplotparm;
   begingraph;
     entrytitle "&amp;amp;var Ciclo &amp;amp;ciclo";
     layout overlay /
 	
	 yaxisopts=( offsetmin=0.01 offsetmax=0.01 tickvalueattrs=(size=5pt )
			linearopts=(tickvaluesequence=(start=1 end=&amp;amp;nvarie
			increment=1) viewmin=1 viewmax=&amp;amp;nvarie			
			tickdisplaylist=(&amp;amp;ylist)))

	xaxisopts=( offsetmin=0.01 offsetmax=0.01 tickvalueattrs=(size=6pt)
			linearopts=(tickvaluesequence=(start=&amp;amp;mn_edad end=&amp;amp;mx_edad
			increment=1) viewmin=&amp;amp;mn_edad viewmax=&amp;amp;mx_edad
			tickvaluefitpolicy = rotatealways
			/*tickvaluerotation=0*/
			tickdisplaylist=(&amp;amp;xlist))) 
	;
contourplotparm x=edad y=orden z=&amp;amp;var /
         contourtype=fill nhint=7 
           name="Contour" colormodel=&amp;amp;m_cmodel;
       continuouslegend "Contour" /  title= "&amp;amp;var" ;

referenceline y=10.5 / lineattrs=(thickness=1 color=black pattern=dash); 
referenceline y=%sysevalf(&amp;amp;lbm-0.5) / lineattrs=(thickness=1 color=black pattern= dot ); 
referenceline y=%sysevalf(&amp;amp;ubm+0.5) / lineattrs=(thickness=1 color=black pattern=dot);
referenceline y=%sysevalf(&amp;amp;lba-0.5) / lineattrs=(thickness=1 color=black pattern=dash);  
endlayout;
   endgraph;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I appreciate your help&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 17:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/860701#M23530</guid>
      <dc:creator>jfgiraldo</dc:creator>
      <dc:date>2023-02-24T17:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional tickvalueattrs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/863217#M23575</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439906"&gt;@jfgiraldo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's not an option to allow you to change the attributes for individual tick values. But, you could use an axis table to place values beside the tick marks (suppressing the axis tick values) so that they appear as the tick values.&amp;nbsp; The axis table will allow you to use an attribute map to change the attributes for individual axis table values.&amp;nbsp; To get this to work, you will need to know the tick values that will be used for the axis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a sample that shows how to do this.&lt;/P&gt;
&lt;PRE&gt;ods path (prepend) work.templat(update);
proc template;
 define statgraph contourplotparm;
   begingraph;
     entrytitle "Contour Plot of Height and Weight";
	/* Define an attribute map named COLORS to associate
	    the group values 1 and 2 with the desired colors */
    discreteattrmap name="colors";
        value "1" / textattrs=(color=red);
        value "2" / textattrs=(color=black); 
     enddiscreteattrmap ;
    /* associate the attribute map with the GRP group variable */
     discreteattrvar attrvar=groupcolors var=grp attrmap="colors"; 
     /* define a lattice layout to place the axis table and plot side by side */ 
     layout lattice / columnweights=preferred columndatarange=union
            rowdatarange=union columns=2;
      /* Use the AXISTABLE statement to place the YVALUE variable values
	 associating the values  with the GROUPCOLORS attribute map 
         variable */
       layout overlay / walldisplay=none xaxisopts=(display=none offsetmin=0
              offsetmax=0) yaxisopts=(display=(label) label="Weight");
         AxisTable Value=yvalue y=yvalue / labelPosition=min 
              colorGroup=groupcolors Display=(Values);
       endlayout;
       /* plot */
       layout overlay / xaxisopts=(offsetmin=0 offsetmax=0
           linearopts=(thresholdmin=0 thresholdmax=0))
         yaxisopts=(display=(line ticks) offsetmin=0 offsetmax=0
	   /* specify the tick values for the axis */
           linearopts=(tickvaluesequence=(start=50 end=250 increment=50)
                       thresholdmin=0 thresholdmax=0));
         contourplotparm x=height y=weight z=density / contourtype=fill 
             nhint=12
             name="Contour" colormodel=twocolorramp;
         continuouslegend "Contour" / title="Density";
       endlayout;
     endlayout;
   endgraph;
 end;
run;
/* create plot data defining the YVALUE variable to contain the axis
   tick values and associating specific values with a group variable, GRP */
data gridded;
  set sashelp.gridded end=last;
  if last then do;
    output;
    do yvalue=50 to 250 by 50;
    if yvalue in(100 200) then grp=1;
    else grp=2;
      output;
    end;
  end;
  else output;
run;
/* Create the plot */
proc sgrender data= gridded template=contourplotparm;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/863217#M23575</guid>
      <dc:creator>MarciaS</dc:creator>
      <dc:date>2023-03-09T15:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional tickvalueattrs</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/874934#M23781</link>
      <description>Thank you.&lt;BR /&gt;Greetings</description>
      <pubDate>Wed, 10 May 2023 13:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Conditional-tickvalueattrs/m-p/874934#M23781</guid>
      <dc:creator>jfgiraldo</dc:creator>
      <dc:date>2023-05-10T13:32:27Z</dc:date>
    </item>
  </channel>
</rss>

