<?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: How to combine bar chart and dot plot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206245#M7687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SGPLOT DOT plot is horizontally oriented.&amp;nbsp; So, you could use an HBAR statement instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; hbar id/response=bar nostatlabel;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dot id/response=dot1 nostatlabel markerattrs=graphdata1(symbol=circlefilled size=10);&lt;/P&gt;&lt;P&gt;&amp;nbsp; dot id/response=dot2 nostatlabel markerattrs=graphdata2(symbol=trianglefilled size=10);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Dot.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10855_Dot.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jun 2015 13:06:22 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2015-06-15T13:06:22Z</dc:date>
    <item>
      <title>How to combine bar chart and dot plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206241#M7683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I combine dot plot and bar chart? I've tried the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input id $1. bar dot1 dot2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a 10 8 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b 15 18 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c 5 20 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d -5 8 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sgplot data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar id/response=bar;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dot id/response=dot1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dot id/response=dot2 ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but got an:&lt;/P&gt;&lt;P&gt;ERROR: All overlays must have the same orientation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to obtain something similar to the attached graph.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11782i14478766A68A87A7/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="bar_dot_excel.png" title="bar_dot_excel.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 11:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206241#M7683</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2015-06-15T11:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine bar chart and dot plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206242#M7684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SGPLOT, you can only use dotplot with horizontal categorization plot statements. In your code you are trying to overlay a vertical plot with a horizontal plot and that is why you get that error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use GTL to achieve what you want. Please try this code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;&amp;nbsp; define statgraph barwithdot;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; begingraph;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; layout overlay;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; barchart x=id y=bar / orient = vertical;&lt;BR /&gt;&amp;nbsp; scatterplot x=id y=dot1 / markerattrs=(color=red symbol=squarefilled);&lt;BR /&gt;&amp;nbsp; scatterplot x=id y=dot2 / markerattrs=(color=green symbol=trianglefilled);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; endlayout;&lt;BR /&gt; endgraph;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgrender data = have template = barwithdot;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 11:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206242#M7684</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-06-15T11:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine bar chart and dot plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206243#M7685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot djrisks. It works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 12:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206243#M7685</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2015-06-15T12:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine bar chart and dot plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206244#M7686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 12:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206244#M7686</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2015-06-15T12:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine bar chart and dot plot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206245#M7687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SGPLOT DOT plot is horizontally oriented.&amp;nbsp; So, you could use an HBAR statement instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; hbar id/response=bar nostatlabel;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dot id/response=dot1 nostatlabel markerattrs=graphdata1(symbol=circlefilled size=10);&lt;/P&gt;&lt;P&gt;&amp;nbsp; dot id/response=dot2 nostatlabel markerattrs=graphdata2(symbol=trianglefilled size=10);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Dot.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/10855_Dot.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 13:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-bar-chart-and-dot-plot/m-p/206245#M7687</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-06-15T13:06:22Z</dc:date>
    </item>
  </channel>
</rss>

