<?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: Is there a way to set different transparency per groups i sgplot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496478#M16961</link>
    <description>&lt;P&gt;Thank you DanH.&lt;/P&gt;&lt;P&gt;Looks like I have to take your way.&lt;/P&gt;&lt;P&gt;However, I merely begin with attribute map, it will be&amp;nbsp;a long shot.&lt;/P&gt;&lt;P&gt;But&amp;nbsp;adjusting lightness/saturation is quite a new way for me. I think it would be the solution (if I can deal with it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wish me luck! I'll search for the post about attrmap and lightness/saturation adjustment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Sep 2018 06:51:37 GMT</pubDate>
    <dc:creator>MonoLight</dc:creator>
    <dc:date>2018-09-18T06:51:37Z</dc:date>
    <item>
      <title>Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/495888#M16945</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on how to set different transparency per groups. I searched in google and SAS help, and tried to use legenditem and discreteattrmap (which was showing red characters... I don't know why. I just copied that from SAS Help book examples).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I got nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code for my sgplot. (Thanks to Rick's advice and tips for spaghetti plot)&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc sgplot data=pilot.pilot9;
	   label Signs="Signs" Petition="Petition";
	   series x=n y=Signs / group=Petition grouplc=max3 lineattrs=(pattern=solid) transparency=0.95 ;
	   xaxis display = (nolabel) values=(10 20 30 40 0 60);
	   yaxis label="Signs" type=log logbase=10 logstyle=logexpand values=(1 100 1000 10000 100000 200000) gridattrs=(pattern=dash color=black);
	   keylegend / type=linecolor title="";
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And here's the result of the graph.&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="SGPlot13.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23291i786354F9C33C275D/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot13.png" alt="SGPlot13.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, most of graphs are included under 100 or 1000, so I tried to set those group with 0.98 of transparency while others have 0.5 or 0.2 of transparencies. So that I can catch which one just popped up from the low signs to higher.&lt;/P&gt;&lt;P&gt;&amp;nbsp;(FYI, I am using SAS 9.4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Sep 2018 08:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/495888#M16945</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-15T08:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/495895#M16947</link>
      <description>&lt;P&gt;You could use multiple SERIES statements in the same PROC SGPLOT, with different transparency levels. In order for this to work, you have to rearrange your input data set so that the X and Y variables in each group are present with unique names, while they are missing for the other groups. So, for example, using SASHELP.CLASS, the input data set to PROC SGPLOT would look like this (where I am using SCATTER, but it works with SERIES):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    set sashelp.class sashelp.class(rename=(height=height1 weight=weight1));
    /* Jitter the data in height1 and weight1 so they can be different, otherwise we won't see them on the plot */
    /* This is needed for this example and not for your real data */
     weight1=weight1+5*rand('normal');
     height1=height1+5*rand('normal');
run;

proc sgplot data=have;
    scatter x=height y=weight/transparency=0.2;
    scatter x=height1 y=weight1/transparency=0.8;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Sep 2018 11:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/495895#M16947</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-15T11:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496064#M16950</link>
      <description>&lt;P&gt;Thank you, and sorry for the late reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rearranging the data is hard for me but it seems I have no choice. I'll give it a try!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 18:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496064#M16950</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-16T18:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496099#M16952</link>
      <description>&lt;P&gt;For the record, FILLTRANSPARENCY and MARKERTRANSPARENCY are supported in discrete attribute maps, which would give you individual transparency per group value (but not for LINEs currently). However, if you CAN use attribute maps to control the color per group in your case (if you don't care about specific colors per group, use the STYLESATTRS statement instead). If you adjust the lightness/saturation in the colors per group, the single transparency value might still work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 01:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496099#M16952</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-09-17T01:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496179#M16954</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/233042"&gt;@MonoLight&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, and sorry for the late reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rearranging the data is hard for me but it seems I have no choice. I'll give it a try!&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why is it hard? I gave an example of rearranging an existing data set to accomplish this purpose.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 10:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496179#M16954</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-17T10:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496244#M16955</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tt.PNG" style="width: 316px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23316i74F7A829C5A8A1F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="tt.PNG" alt="tt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data has about 70 "n"s.&lt;/P&gt;&lt;P&gt;And COL1~COL33600.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it's sorted like the screenshot above. So there are about 70 * 33600 rows in there.&lt;/P&gt;&lt;P&gt;I'm figuring out how to make this one into your setting.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 14:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496244#M16955</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-17T14:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496274#M16957</link>
      <description>&lt;P&gt;If the values of PETITION go from COL1 to COL33600, you'd probably need a macro to create the data as needed to graph them with separate transparencies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro would loop through all of the COL1 through COL33600, modifying the data set as I described in my original method. You'd also have to have 33600 SERIES statements, each with its own transparency level. Depending on the speed and memory of your computer, this could take quite a while to run.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 15:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496274#M16957</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-17T15:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496356#M16959</link>
      <description>&lt;P&gt;Oh I forgot to mention.&lt;/P&gt;&lt;P&gt;I got COL1 ~33600 for Petition, but I also made the variable(max3) which group them in 7 categories.&lt;/P&gt;&lt;P&gt;So I hope I can use that to draw a graph setting 7 different transparency. But I'm not sure I can do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I got headache in whole weekend (maybe because of SAS) so I'll try it tomorrow with all advice.&lt;/P&gt;&lt;P&gt;Making macro is beyond my skills, so maybe other way would be needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But thanks for considering my problem, really!&lt;/P&gt;&lt;P&gt;Also if you got some other advice popped up, please let me know!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 18:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496356#M16959</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-17T18:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496478#M16961</link>
      <description>&lt;P&gt;Thank you DanH.&lt;/P&gt;&lt;P&gt;Looks like I have to take your way.&lt;/P&gt;&lt;P&gt;However, I merely begin with attribute map, it will be&amp;nbsp;a long shot.&lt;/P&gt;&lt;P&gt;But&amp;nbsp;adjusting lightness/saturation is quite a new way for me. I think it would be the solution (if I can deal with it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wish me luck! I'll search for the post about attrmap and lightness/saturation adjustment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 06:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496478#M16961</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-18T06:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to set different transparency per groups i sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496539#M16966</link>
      <description>&lt;P&gt;For seven categories, I would not even think about a macro, just brute force program this as in my earlier example. So&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have2;
    set have(where=(max3=1) rename=(n=n1 signs=signs1)) 
        have(where=(max3=2) rename=(n=n2 signs=signs2))
        have(where=(max3=3) rename=(n=n3 signs=signs3))
        have(where=(max3=4) rename=(n=n4 signs=signs4))
        have(where=(max3=5) rename=(n=n5 signs=signs5))
        have(where=(max3=6) rename=(n=n6 signs=signs6))
        have(where=(max3=7) rename=(n=n7 signs=signs7));
run;

proc sgplot data=have2;
    scatter x=n1 y=signs1/transparency=0.2;
    scatter x=n2 y=signs2/transparency=0.8;
    /* Additional scatter statements go here, I left them out to save me some typing */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where I assume the values of max3 are 1 to 7 (if they are not 1 to 7, then make the obvious change to the code above).&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 12:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-a-way-to-set-different-transparency-per-groups-i-sgplot/m-p/496539#M16966</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-09-18T12:42:05Z</dc:date>
    </item>
  </channel>
</rss>

