<?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: Questions with logarithm axis graph with sgplot! in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495703#M16936</link>
    <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;How can I ease the message and set the logarithm?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Because the LOG function is not defined at 0, you cannot mathematically perform the task that you are requesting. Your options are&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1) Set values that are 0 to missing. That will cause those data points to be skipped in the graph&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) Set values that are 0 to 1.&amp;nbsp;On a graph whose vertical axis goes to 100,000, no one will be able to tell the difference between a small count and a zero count.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your second question, I got an error when I tried to run the sample data that you provided. However, the general question about how to color lines in a spaghetti plot is addressed (with examples) in the article &lt;A href="https://blogs.sas.com/content/iml/2016/06/02/create-spaghetti-plots-in-sas.html" target="_self"&gt;"Create spaghetti plots in SAS."&lt;/A&gt;&amp;nbsp;The main idea is to associate a categorical variable with each series and use the GROUPLC= option to assign colors. For example, if you create a variable in the data set called SIZE which is constant&amp;nbsp;for each series which has the values, 10, 100, 1000, 10000, and 100000, then you can add GROUPLC=SIZE to the SERIES statement to color the lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding "is there a better way," the answer is probably yes. I don't&amp;nbsp;think&amp;nbsp;you are going to glean much insight from plotting 30,000 series&amp;nbsp;at 70 time points. I suggest that you describe&amp;nbsp;what you are trying to ACCOMPLISH. Are you trying to identify series that are outliers? Are you monitoring the values and want to find processes&amp;nbsp;that are "out of control." Are you trying to visualize trends? You can answer these questions without&amp;nbsp;plotting 30,000 series.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2018 14:45:57 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-09-14T14:45:57Z</dc:date>
    <item>
      <title>Questions with logarithm axis graph with sgplot!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495566#M16931</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to ask 2 questions about the logarithm axis graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, I'd like to show my code as well. But please excuse me that I put the original libname and excel data in the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Test;&lt;BR /&gt;Input COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 hour;&lt;BR /&gt;Cards;&lt;BR /&gt;0 0 0 0 0 1123 90515 21879 1&lt;BR /&gt;4 24 14 27 220 1123 92276 21887 2&lt;BR /&gt;105 36 21 39 100203 1124 97904 21976 4&lt;BR /&gt;176 36 21 39 218485 1124 99477 22021 5&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;BR /&gt;

Proc Transpose
	data = Test out=Test2(drop = _NAME_ drop = _LABEL_ rename=(Col1=Signs))
	name = Petition;
	by hour;
	var COL1-COL8;
	Run;


proc sgplot data=pilot.pilot5;
   label Signs="Signs" Petition="Petition";
   series x=n y=Signs / group=Petition lineattrs=(color=blue pattern=solid);
   yaxis label="Signs" type=log logbase=10 logstyle=logexpand values = (100 500 10000 100000 200000);
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;Thanks to Rick, I managed to know about logarithm scale in my graph, but it has an zero number or negative value issue.&lt;/P&gt;&lt;P&gt;This just popped on the log :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: The log axis cannot support zero or negative values for the axis from plot data or due to default or assigned&lt;BR /&gt; BASELINEINTERCEPT value. The axis type will be changed to LINEAR&lt;/PRE&gt;&lt;P&gt;How can I ease the message and set the logarithm sacle?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I transposed the data according to the blog following:&lt;A href="https://blogs.sas.com/content/iml/2015/02/25/plotting-multiple-series-transforming-data-from-wide-to-long.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2015/02/25/plotting-multiple-series-transforming-data-from-wide-to-long.html&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;(And it was Rick again! I didn't know until this time. Thanks Rick again.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is, Can I choose some COL values which have more than 10,000, 100,000 value in the latest hour?&lt;/P&gt;&lt;P&gt;In the data above, COL5 should be chosen as more than 100,000, and COL7 and COL8 should be chosen as more than 10,000.&lt;/P&gt;&lt;P&gt;After that, I want to draw different color of series graph for them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Please note that the original data have about 30000 COLs, and 70 hours now. and later... it would be about 70000 COLs and 720 hours) (If there is a better way to draw series graph with those data, please give me a hint!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the advice, and helps!&lt;/P&gt;&lt;P&gt;I wish I can get you a coffee whoever helps me...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 05:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495566#M16931</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-14T05:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Questions with logarithm axis graph with sgplot!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495695#M16934</link>
      <description>&lt;P&gt;For your last question, Check ranges= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yaxis ranges=&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495695#M16934</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-14T14:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Questions with logarithm axis graph with sgplot!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495703#M16936</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;How can I ease the message and set the logarithm?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Because the LOG function is not defined at 0, you cannot mathematically perform the task that you are requesting. Your options are&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1) Set values that are 0 to missing. That will cause those data points to be skipped in the graph&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) Set values that are 0 to 1.&amp;nbsp;On a graph whose vertical axis goes to 100,000, no one will be able to tell the difference between a small count and a zero count.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your second question, I got an error when I tried to run the sample data that you provided. However, the general question about how to color lines in a spaghetti plot is addressed (with examples) in the article &lt;A href="https://blogs.sas.com/content/iml/2016/06/02/create-spaghetti-plots-in-sas.html" target="_self"&gt;"Create spaghetti plots in SAS."&lt;/A&gt;&amp;nbsp;The main idea is to associate a categorical variable with each series and use the GROUPLC= option to assign colors. For example, if you create a variable in the data set called SIZE which is constant&amp;nbsp;for each series which has the values, 10, 100, 1000, 10000, and 100000, then you can add GROUPLC=SIZE to the SERIES statement to color the lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding "is there a better way," the answer is probably yes. I don't&amp;nbsp;think&amp;nbsp;you are going to glean much insight from plotting 30,000 series&amp;nbsp;at 70 time points. I suggest that you describe&amp;nbsp;what you are trying to ACCOMPLISH. Are you trying to identify series that are outliers? Are you monitoring the values and want to find processes&amp;nbsp;that are "out of control." Are you trying to visualize trends? You can answer these questions without&amp;nbsp;plotting 30,000 series.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 14:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495703#M16936</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-09-14T14:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Questions with logarithm axis graph with sgplot!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495732#M16937</link>
      <description>&lt;P&gt;Thank you again Rick. And sorry for the error. I tried to ask question without attaching excel file so that anyone can read it simple way. But it seems I had done some mistake in there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your advices,&lt;/P&gt;&lt;P&gt;I substituted all 0 values into 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what I am trying to accomplish is... visualizing trends while I can stress some contrasts gap of values.&lt;/P&gt;&lt;P&gt;Actually I'm following precedent study, and just trying to track what they have done. But you got a point. In the study, it only shows the basic trends. But it was quite... impressive. So that's why I'm trying to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it seems it's going to be very heavy if I collect data for 30 days. So I'm thinking about simplifying it.&lt;/P&gt;&lt;P&gt;I'll attach the sgplot I drew. Actually It's um... messy right now, but I want to show you how it went.&lt;/P&gt;&lt;P&gt;&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="Figure 3.1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23280iC586B37358D97700/image-size/large?v=v2&amp;amp;px=999" role="button" title="Figure 3.1.png" alt="Figure 3.1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And for the solutions you mentioned, (especially Spaghetti plots! that's what i wanted) I'm working on it!&lt;/P&gt;&lt;P&gt;Thank you for the help again Rick.&lt;/P&gt;&lt;P&gt;I really appreciate.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 15:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495732#M16937</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-14T15:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Questions with logarithm axis graph with sgplot!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495733#M16938</link>
      <description>&lt;P&gt;Thank you for the advice Ksharp!&lt;/P&gt;&lt;P&gt;But unfortunately, I'm beginner of SAS so... it will take some times to check what you said.&lt;/P&gt;&lt;P&gt;I'm looking on SAS HELP for options you mentioned now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 15:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/495733#M16938</guid>
      <dc:creator>MonoLight</dc:creator>
      <dc:date>2018-09-14T15:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Questions with logarithm axis graph with sgplot!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/780941#M22332</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;, I am having trouble in generating&amp;nbsp; semi log graph using the proc template. Can you please identify what I am doing wrong in my code. It only generating linear graph. Thank you very much.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data = sashelp.class nway;
class age sex;
var weight;
output out= class_mean n=n mean= _MEAN std= sd ;
run;

data mean1;
set class_mean;

lower = _MEAN - sd;
upper = _MEAN - sd;
run;

ods path(prepend) work.templat(update);
proc template;
	define statgraph series;
	begingraph/ BORDER=False datasymbols=( circle Asterisk) ;
	   layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;
	      layout overlay / xaxisopts=( label=('Age') tickvalueattrs=(family='Courier New' size=8 ) labelattrs=(family='Courier New' size=8 )
										linearopts=( viewmin=10 viewmax=20 tickvaluesequence=( start=0.0 end=20 increment=1)))
							yaxisopts=( label=('weight)') type=log labelattrs=(family='Courier New' size=8 ) tickvalueattrs=(family='Courier New' size=8 )
										linearopts=( viewmin=40 viewmax=160.0 tickvaluesequence=( start=0.0 end=160.0 increment=20.0)));
	         seriesplot x=age y= _MEAN /   group=sex name='series' display=(markers) connectorder=xaxis ;
	         scatterplot x=age y= _MEAN /  yerrorupper = upper yerrorlower = lower group=trtan name='scatter';
	         discretelegend 'series' / opaque=false border=true halign=right valign=top displayclipped=true across=2 order=rowmajor location=inside titleattrs=(family='Courier New' size=8 );
	      endlayout;
	   endlayout;
	endgraph;
	end;
run;


ods graphics on/ width=9 in height=4.6 in   ;

options orientation = landscape errors = 2 missing = ' ' nofmterr ls = 175 validvarname = upcase nofmterr nobyline 
noquotelenmax ;
ods escapechar = '^';
ods results on; 
ods listing close; 
ods rtf file = "&amp;amp;location.\chk.rtf" 
						style = rtf  nogtitle nogfootnote;
	
proc sgrender data=mean1 template=series;

run;
ods rtf close;
ods listing close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Nov 2021 05:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Questions-with-logarithm-axis-graph-with-sgplot/m-p/780941#M22332</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-11-18T05:54:38Z</dc:date>
    </item>
  </channel>
</rss>

