<?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 GTL Scatter Series plots with linear X axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894117#M24105</link>
    <description>&lt;P&gt;I am achieving a series plot with markers in GTL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template ;

  define statgraph series_scatter ;

    dynamic _X
            _Y
            _Curve
            _Group
            ;

    begingraph
             / border             = false
               datacolors         = ( Black
                                      Red
                                      Blue
                                      Aqua
                                      Magenta
                                      Orange
                                    )
               datalinepatterns   = ( Solid
                                      ShortDash
                                      MediumDash
                                      LongDash
                                      MediumDashShortDash
                                      DashDashDot
                                      DashDotDot
                                      Dash
                                      LongDashShortDash
                                      Dot
                                      ThinDot
                                      ShortDashDot
                                      MediumDashDotDot
                                    )
               datasymbols        = ( CircleFilled
                                      TriangleFilled
                                      TriangleDownFilled
                                      DiamondFilled
                                      SquareFilled
                                      Plus
                                      x
                                      Asterisk
                                      Circle
                                      Triangle
                                      TriangleDown
                                      Diamond
                                      Square
                                    )
               axisbreaktype      = axis
               axisbreaksymbol    = bracket
               ;

      layout overlay
           /
             xaxisopts = ( label             = "Time (Days)"
                           type              = linear
                            linearopts        = ( tickvaluelist   = ( 0 1 2 3 4 7 14 28 )
                                                  tickdisplaylist = ( "Baseline" "Day 1" "Day 2" "Day 3" "Day 4" "Day 7" "Day 14" "Day 28" )
                                                 )
                           offsetmin         = 0.05
                           offsetmax         = 0.05
                         )
             yaxisopts = ( label             = "Label"
/*                           type              = linear*/
                           linearopts        = ( includeranges     = ( 0 - 90  820 - 840 ))
                           offsetmin         = 0.025
                           offsetmax         = 0.025
                         )
             ;

        seriesplot x = _X
                   y = _Y
                 / group = _Group
                   name  = "series"
/*                   primary     = true */
                   ;

        scatterplot x = _X
                    y = _Y
                  / group       = _Group
                    name        = "scatter"
                    markerattrs = ( size = 5 )
                    ;

        referenceline y = 0
                    / lineattrs = ( thickness = 1
                                    color     = black
                                    pattern   = dash
                                  )
                      curvelabel = "LLN = 0"
                      ;

        referenceline y = 60
                    / lineattrs = ( thickness = 1
                                    color     = black
                                    pattern   = dash
                                  )
                      curvelabel = "ULN = 60"
                      ;

        mergedlegend "scatter"
                     "series"
                   / border = true
                     title  = " "
                     ;

      endlayout ;

    endgraph ;

  end ;

run ;

ods listing close ;
options orientation = landscape topmargin = 0.75in bottommargin = 0.75in rightmargin = 0.75in leftmargin = 0.75in ;
ods results ;
ods rtf file = "~\test.rtf" style = styles.custom nogtitle nogfootnote ;

ods graphics on
  / height = 3.5in
    width  = 9in
    border = off
    ;

proc sgrender
   data      = &amp;amp;outsas.
   template  = series_scatter
   ;

   dynamic _X      = "avisit"
           _Y      = "aval"
           _Group  = "subjid"
           ;

  by studyid
     dose
     ;

run ;

ods rtf close ;
ods listing ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The issue is that the Days are evenly spaced as if nominal:&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="xaxis.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87919iB38F162D50E50C21/image-size/large?v=v2&amp;amp;px=999" role="button" title="xaxis.jpg" alt="xaxis.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I add TYPE = LINEAR (uncomment above), then I get the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: SERIESPLOT statement has a conflict with the axis type. The plot will not be drawn.&lt;BR /&gt;WARNING: SCATTERPLOT statement has a conflict with the axis type. The plot will not be drawn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried changing the order of SERIESPLOT and SCATTERPLOT statements and added PRIMARY = TRUE to the the SERIESPLOT.&amp;nbsp; Any corrections, references, or suggestions are welcomed.&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;
&lt;P&gt;Kevin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 16:42:43 GMT</pubDate>
    <dc:creator>KevinViel</dc:creator>
    <dc:date>2023-09-13T16:42:43Z</dc:date>
    <item>
      <title>GTL Scatter Series plots with linear X axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894117#M24105</link>
      <description>&lt;P&gt;I am achieving a series plot with markers in GTL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template ;

  define statgraph series_scatter ;

    dynamic _X
            _Y
            _Curve
            _Group
            ;

    begingraph
             / border             = false
               datacolors         = ( Black
                                      Red
                                      Blue
                                      Aqua
                                      Magenta
                                      Orange
                                    )
               datalinepatterns   = ( Solid
                                      ShortDash
                                      MediumDash
                                      LongDash
                                      MediumDashShortDash
                                      DashDashDot
                                      DashDotDot
                                      Dash
                                      LongDashShortDash
                                      Dot
                                      ThinDot
                                      ShortDashDot
                                      MediumDashDotDot
                                    )
               datasymbols        = ( CircleFilled
                                      TriangleFilled
                                      TriangleDownFilled
                                      DiamondFilled
                                      SquareFilled
                                      Plus
                                      x
                                      Asterisk
                                      Circle
                                      Triangle
                                      TriangleDown
                                      Diamond
                                      Square
                                    )
               axisbreaktype      = axis
               axisbreaksymbol    = bracket
               ;

      layout overlay
           /
             xaxisopts = ( label             = "Time (Days)"
                           type              = linear
                            linearopts        = ( tickvaluelist   = ( 0 1 2 3 4 7 14 28 )
                                                  tickdisplaylist = ( "Baseline" "Day 1" "Day 2" "Day 3" "Day 4" "Day 7" "Day 14" "Day 28" )
                                                 )
                           offsetmin         = 0.05
                           offsetmax         = 0.05
                         )
             yaxisopts = ( label             = "Label"
/*                           type              = linear*/
                           linearopts        = ( includeranges     = ( 0 - 90  820 - 840 ))
                           offsetmin         = 0.025
                           offsetmax         = 0.025
                         )
             ;

        seriesplot x = _X
                   y = _Y
                 / group = _Group
                   name  = "series"
/*                   primary     = true */
                   ;

        scatterplot x = _X
                    y = _Y
                  / group       = _Group
                    name        = "scatter"
                    markerattrs = ( size = 5 )
                    ;

        referenceline y = 0
                    / lineattrs = ( thickness = 1
                                    color     = black
                                    pattern   = dash
                                  )
                      curvelabel = "LLN = 0"
                      ;

        referenceline y = 60
                    / lineattrs = ( thickness = 1
                                    color     = black
                                    pattern   = dash
                                  )
                      curvelabel = "ULN = 60"
                      ;

        mergedlegend "scatter"
                     "series"
                   / border = true
                     title  = " "
                     ;

      endlayout ;

    endgraph ;

  end ;

run ;

ods listing close ;
options orientation = landscape topmargin = 0.75in bottommargin = 0.75in rightmargin = 0.75in leftmargin = 0.75in ;
ods results ;
ods rtf file = "~\test.rtf" style = styles.custom nogtitle nogfootnote ;

ods graphics on
  / height = 3.5in
    width  = 9in
    border = off
    ;

proc sgrender
   data      = &amp;amp;outsas.
   template  = series_scatter
   ;

   dynamic _X      = "avisit"
           _Y      = "aval"
           _Group  = "subjid"
           ;

  by studyid
     dose
     ;

run ;

ods rtf close ;
ods listing ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The issue is that the Days are evenly spaced as if nominal:&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="xaxis.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87919iB38F162D50E50C21/image-size/large?v=v2&amp;amp;px=999" role="button" title="xaxis.jpg" alt="xaxis.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I add TYPE = LINEAR (uncomment above), then I get the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: SERIESPLOT statement has a conflict with the axis type. The plot will not be drawn.&lt;BR /&gt;WARNING: SCATTERPLOT statement has a conflict with the axis type. The plot will not be drawn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried changing the order of SERIESPLOT and SCATTERPLOT statements and added PRIMARY = TRUE to the the SERIESPLOT.&amp;nbsp; Any corrections, references, or suggestions are welcomed.&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;
&lt;P&gt;Kevin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 16:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894117#M24105</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2023-09-13T16:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: GTL Scatter Series plots with linear X axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894122#M24108</link>
      <description>&lt;P&gt;Can't test anything without data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try commenting out the TYPE=LINEAR for the XAXISOPTS?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 17:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894122#M24108</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-13T17:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: GTL Scatter Series plots with linear X axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894126#M24109</link>
      <description>&lt;P&gt;Doh!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is that I used the WRONG variable for _X:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data test ;
  retain studyid "1"
         dose    "1"
         ;

  length subjid $ 4 ;
  do subjid = "1" , "2" , "Mean" ;
    do avisitn = 0 , 1 , 2 , 3 , 4 , 7 , 14 , 28 ;
      aval = 10 * ranuni( 1 ) ;
      output ;
    end ;
  end ;
run ;

proc sgrender
   data      = test
   template  = series_scatter
   ;

   dynamic _X      = "avisitn"
           _Y      = "aval"
           _Group  = "subjid"
           ;

  by studyid
     dose
     ;

run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;AVISIT is the character version of AVISITN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, I am on to other (real) issues &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 18:01:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894126#M24109</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2023-09-13T18:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: GTL Scatter Series plots with linear X axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894133#M24111</link>
      <description>&lt;P&gt;Glad you found the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish I could say I haven't made a similar mistake of variable name in the past year sometime. Wish, can't say it truthfully...&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 18:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/GTL-Scatter-Series-plots-with-linear-X-axis/m-p/894133#M24111</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-13T18:38:41Z</dc:date>
    </item>
  </channel>
</rss>

