<?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: Scatterplot of two rasters in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/scatterplot-of-two-rasters-in-python/m-p/668717#M51893</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;conceptually, if you are doing this on a cell by cell basis, you could use &lt;A href="http://RasterToNumpyArray/" rel="nofollow noopener noreferrer" target="_blank"&gt;RasterToNumpyArray &lt;/A&gt;to convert the rasters to arrays...then 'flatten' the arrays so they essentially become X, Y pairs, then you can use matplotlib to do the scatter plot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from matplotlib import pyplot as plt
xs = [1,3,2,5,6,4]
ys = [3,2,1,5,3,2]
plt.scatter(xs, ys)
main_title ="My first graph"
plt.title(main_title, loc='center')&amp;nbsp; #loc is either left, right or center
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2)
plt.tick_params(which='minor', direction='in', length=4, width=2)
plt.show()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:15:56 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-12T04:15:56Z</dc:date>
    <item>
      <title>Scatterplot of two rasters in Python</title>
      <link>https://community.esri.com/t5/python-questions/scatterplot-of-two-rasters-in-python/m-p/668716#M51892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ALL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing a Temperature-Vegetation Dryness Index (TDVI) analysis using Normalized Difference Vegetation Index (NDVI) and Land Surface Temperature (LST) for drought assessment. I need to create a scatterplot of LST and NDVI. Can you help me do this in Python? or at least guide me on how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Leo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 09:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/scatterplot-of-two-rasters-in-python/m-p/668716#M51892</guid>
      <dc:creator>Leo_KrisPalao</dc:creator>
      <dc:date>2015-01-08T09:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot of two rasters in Python</title>
      <link>https://community.esri.com/t5/python-questions/scatterplot-of-two-rasters-in-python/m-p/668717#M51893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;conceptually, if you are doing this on a cell by cell basis, you could use &lt;A href="http://RasterToNumpyArray/" rel="nofollow noopener noreferrer" target="_blank"&gt;RasterToNumpyArray &lt;/A&gt;to convert the rasters to arrays...then 'flatten' the arrays so they essentially become X, Y pairs, then you can use matplotlib to do the scatter plot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from matplotlib import pyplot as plt
xs = [1,3,2,5,6,4]
ys = [3,2,1,5,3,2]
plt.scatter(xs, ys)
main_title ="My first graph"
plt.title(main_title, loc='center')&amp;nbsp; #loc is either left, right or center
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2)
plt.tick_params(which='minor', direction='in', length=4, width=2)
plt.show()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:15:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/scatterplot-of-two-rasters-in-python/m-p/668717#M51893</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T04:15:56Z</dc:date>
    </item>
  </channel>
</rss>

