<?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: Dynamic sgplot labels in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758193#M30187</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391594"&gt;@ggunaward&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I think you're misunderstanding. I'm not trying to change the plot at all. I'm trying to take the calculations from my proc iml statement, for example kurtosis_Normal and kurtosis_Cauchy, and replace "Quantiles" in xaxix label with them. Is that possible?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you show us (even if it is a hand-drawing) what you want?&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jul 2021 18:27:46 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-07-29T18:27:46Z</dc:date>
    <item>
      <title>Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758177#M30180</link>
      <description>&lt;P&gt;Hi so I'm trying to set up dynamic x axis labels for an sgplot plot, but can't figure out how to do it. I did the calculations&amp;nbsp; in proc iml and stored them:&lt;/P&gt;&lt;P&gt;/* Calculate skewness and kurtosis for each sample */&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;use CombinedSamples;&lt;BR /&gt;read all;&lt;/P&gt;&lt;P&gt;kurtosis_Normal = kurtosis(Normal);&lt;BR /&gt;kurtosis_Cauchy = kurtosis(Cauchy);&lt;BR /&gt;kurtosis_Weibull = kurtosis(Weibull);&lt;BR /&gt;kurtosis_Laplace = kurtosis(Laplace);&lt;BR /&gt;skewness_Normal = skewness(Normal);&lt;BR /&gt;skewness_Cauchy = skewness(Cauchy);&lt;BR /&gt;skewness_Weibull = skewness(Weibull);&lt;BR /&gt;skewness_Laplace = skewness(Laplace);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;print "Results";&lt;/P&gt;&lt;P&gt;print kurtosis_Normal kurtosis_Cauchy kurtosis_Weibull kurtosis_Laplace;&lt;BR /&gt;print skewness_Normal skewness_Cauchy skewness_Weibull skewness_Laplace;&lt;BR /&gt;store _all_ module=_all_;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure how to add it to the axis of my graph:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Set Up for Part C */&lt;BR /&gt;proc rank data=CombinedSamples normal=blom out=CombinedSamplesQuant;&lt;BR /&gt;var Normal Cauchy Weibull Laplace;&lt;BR /&gt;ranks Normal_Quant Cauchy_Quant Weibull_Quant Laplace_Quant;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Create Combined QQPlots */&lt;BR /&gt;title 'Q-Q Plot for Normal, Cauchy, Weibull, and Laplace Distributions';&lt;BR /&gt;proc sgplot data=CombinedSamplesQuant;&lt;BR /&gt;scatter x=Normal_Quant y=Normal;&lt;BR /&gt;scatter x=Cauchy_Quant y=Cauchy;&lt;BR /&gt;scatter x=Weibull_Quant y=Weibull;&lt;BR /&gt;scatter x=Laplace_Quant y=Laplace;&lt;BR /&gt;xaxis label="Quantiles";&lt;BR /&gt;yaxis min=-500 max=500;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to instead do the calculations in a macro or somehow within sgplot?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 17:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758177#M30180</guid>
      <dc:creator>ggunaward</dc:creator>
      <dc:date>2021-07-29T17:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758185#M30183</link>
      <description>&lt;P&gt;If you want to overlay scatter plots into one big PROC SGPLOT output, you can have a legend created that indicates which color scatterplot belongs to which data. For example, see here:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n1vkttjoy99wkwn1iyy9leor7xg2.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n1vkttjoy99wkwn1iyy9leor7xg2.htm&lt;/A&gt;&amp;nbsp;but in this case, the values of the x-axis variable are the same in each call to SERIES (same would be true for SCATTER). Your code doesn't show that, but I think you can rearrange your data such that the x-axis is a variable named QUANTILE for each plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Do I need to instead do the calculations in a macro or somehow within sgplot?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;No.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 18:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758185#M30183</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-29T18:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758191#M30186</link>
      <description>I think you're misunderstanding. I'm not trying to change the plot at all. I'm trying to take the calculations from my proc iml statement, for example kurtosis_Normal and kurtosis_Cauchy, and replace "Quantiles" in xaxix label with them. Is that possible?</description>
      <pubDate>Thu, 29 Jul 2021 18:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758191#M30186</guid>
      <dc:creator>ggunaward</dc:creator>
      <dc:date>2021-07-29T18:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758193#M30187</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391594"&gt;@ggunaward&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I think you're misunderstanding. I'm not trying to change the plot at all. I'm trying to take the calculations from my proc iml statement, for example kurtosis_Normal and kurtosis_Cauchy, and replace "Quantiles" in xaxix label with them. Is that possible?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you show us (even if it is a hand-drawing) what you want?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 18:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758193#M30187</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-29T18:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758197#M30189</link>
      <description>Okay so essentially for that last part:&lt;BR /&gt;&lt;BR /&gt;/* Create Combined QQPlots */&lt;BR /&gt;title 'Q-Q Plot for Normal, Cauchy, Weibull, and Laplace Distributions';&lt;BR /&gt;proc sgplot data=CombinedSamplesQuant;&lt;BR /&gt;scatter x=Normal_Quant y=Normal;&lt;BR /&gt;scatter x=Cauchy_Quant y=Cauchy;&lt;BR /&gt;scatter x=Weibull_Quant y=Weibull;&lt;BR /&gt;scatter x=Laplace_Quant y=Laplace;&lt;BR /&gt;xaxis label="Quantiles";&lt;BR /&gt;yaxis min=-500 max=500;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;I want to replace "xaxis label="Quantiles";"&lt;BR /&gt;&lt;BR /&gt;with "xaxis label="Normal Distribution Kurtosis:" #Kurtosis Variable# "Skewness:" #Skewness Variable#;"</description>
      <pubDate>Thu, 29 Jul 2021 18:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758197#M30189</guid>
      <dc:creator>ggunaward</dc:creator>
      <dc:date>2021-07-29T18:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758210#M30191</link>
      <description>&lt;P&gt;Do you want four separate plots, one for Normal, one for Cauchy, one for Weibull, one for Laplace?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 18:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758210#M30191</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-29T18:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758255#M30192</link>
      <description>No, just one plot. The plot that I have is actually fine. I'm purposely plotting each scatter plot on the same plot. The problem I'm having is that the data is randomly generated from a distribution, and so I want a label that shows in plain text, the kurtosis and skewness for each distribution whenever the sas page is run. Essentially I'm trying to figure out how to put a calculation into a label, either via a variable or by doing the calculation on the dataset right then and there. Is that possible?</description>
      <pubDate>Thu, 29 Jul 2021 20:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758255#M30192</guid>
      <dc:creator>ggunaward</dc:creator>
      <dc:date>2021-07-29T20:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758293#M30196</link>
      <description>&lt;P&gt;I'm not sure it this is completely applicable, but Rick Wicklin wrote a post a few months ago (February 2021) on customizations.&amp;nbsp; He talks about different means of doing this including simple things like #ByVar and #ByVal (which I don't think will help us here) but also more complex things using SGPANEL and Macros for customizing things.&amp;nbsp; I'm not sure if it will be helpful, but I thought it worth mentioning:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2021/02/22/byvar-byval-keywords-sas-titles.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2021/02/22/byvar-byval-keywords-sas-titles.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 22:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758293#M30196</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-29T22:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758307#M30198</link>
      <description>Okay thanks everyone I think I see how to do it now. Within my proc iml statement, I need to put my variables into macro variables like in here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/25042043/using-a-vector-generated-in-sas-iml-as-a-macro-variable" target="_blank"&gt;https://stackoverflow.com/questions/25042043/using-a-vector-generated-in-sas-iml-as-a-macro-variable&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and then call the macro variable in one of my sgplot labels like in here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2021/02/22/byvar-byval-keywords-sas-titles.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2021/02/22/byvar-byval-keywords-sas-titles.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Does that seem like it would work?</description>
      <pubDate>Fri, 30 Jul 2021 01:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758307#M30198</guid>
      <dc:creator>ggunaward</dc:creator>
      <dc:date>2021-07-30T01:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758311#M30199</link>
      <description>Sounds like it should work.&lt;BR /&gt;&lt;BR /&gt;Jim</description>
      <pubDate>Fri, 30 Jul 2021 02:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758311#M30199</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-30T02:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sgplot labels</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758329#M30201</link>
      <description>&lt;P&gt;It worked! Thanks! Also had to reference this for the right quotations for the strings:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001071889.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001071889.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 05:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dynamic-sgplot-labels/m-p/758329#M30201</guid>
      <dc:creator>ggunaward</dc:creator>
      <dc:date>2021-07-30T05:37:41Z</dc:date>
    </item>
  </channel>
</rss>

