<?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: SGPlot axes through origin with negative data in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244502#M8863</link>
    <description>&lt;P&gt;I don't think there is a way to do this in SGPLOT. &amp;nbsp;However, you can do this using GTL.&lt;/P&gt;
&lt;P&gt;In your case, your data would span across (0, 0), and you would set the x and y origins at zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1497i1C6A7700C8CE2739/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Axis_Origin.png" title="Axis_Origin.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt;&amp;nbsp; define statgraph class;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; begingraph;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; entrytitle 'Weight by Height for all Students';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; layout overlay / xaxisopts=(linearopts=(&lt;STRONG&gt;origin=60&lt;/STRONG&gt;))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yaxisopts=(linearopts=(&lt;STRONG&gt;origin=100&lt;/STRONG&gt;));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scatterplot x=height y=weight / group=sex name='a';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; discretelegend 'a';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; endlayout;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; endgraph;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sgrender data=sashelp.class template=class;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2016 18:02:55 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2016-01-19T18:02:55Z</dc:date>
    <item>
      <title>SGPlot axes through origin with negative data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244358#M8845</link>
      <description>&lt;P&gt;I'm creating a scatterplot using sgplot. My points have both positive and negative values. I would like to draw two axes through (0,0), but keep the axis labels at the edge of the graph. What's the best way to do this? (I know I can use lineparm, but I'm hoping there is a simpler option).&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 06:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244358#M8845</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2016-01-19T06:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: SGPlot axes through origin with negative data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244392#M8848</link>
      <description>REFLINE 0 / axis=x;&lt;BR /&gt;&lt;BR /&gt;REFLINE 0 / axis=y;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;That draws the reference lines, but leaves the axes automatically positioned.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jan 2016 10:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244392#M8848</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-19T10:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: SGPlot axes through origin with negative data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244394#M8849</link>
      <description>&lt;P&gt;Many thanks. That solves my current problem. For future reference (if I want to present this data differently) how do I get the axes with tickmarks and labels to go through (0,0)?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 10:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244394#M8849</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2016-01-19T10:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: SGPlot axes through origin with negative data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244397#M8850</link>
      <description>&lt;P&gt;I'll let someone else advice as to how it might be accomplished.&amp;nbsp; In my opinion, you shouldn't do it. The center of the plot should be reserved for the data, with the axis ticks, values, and labels positioned to the outside. This is based on basic principles of graphing (a la Tufte) which state that the data should be presented as purely and unadorned as possible.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 11:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244397#M8850</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-19T11:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: SGPlot axes through origin with negative data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244414#M8851</link>
      <description>&lt;P&gt;Another thought: To obtain a whole grid of reference lines, where each line is aligned with axes ticks, use the GRID option on the XAXIS and YAXIS statements, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;xaxis grid;
yaxis grid;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That gives you all of the advantages of axes that cut through the plot area, but keeps the tick values and labels on the outside of the plot area.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 12:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244414#M8851</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-19T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: SGPlot axes through origin with negative data</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244502#M8863</link>
      <description>&lt;P&gt;I don't think there is a way to do this in SGPLOT. &amp;nbsp;However, you can do this using GTL.&lt;/P&gt;
&lt;P&gt;In your case, your data would span across (0, 0), and you would set the x and y origins at zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1497i1C6A7700C8CE2739/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Axis_Origin.png" title="Axis_Origin.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt;&amp;nbsp; define statgraph class;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; begingraph;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; entrytitle 'Weight by Height for all Students';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; layout overlay / xaxisopts=(linearopts=(&lt;STRONG&gt;origin=60&lt;/STRONG&gt;))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yaxisopts=(linearopts=(&lt;STRONG&gt;origin=100&lt;/STRONG&gt;));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scatterplot x=height y=weight / group=sex name='a';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; discretelegend 'a';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; endlayout;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; endgraph;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sgrender data=sashelp.class template=class;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 18:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPlot-axes-through-origin-with-negative-data/m-p/244502#M8863</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2016-01-19T18:02:55Z</dc:date>
    </item>
  </channel>
</rss>

