<?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: Overlay raster and vector using matplotlib and faceting in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/overlay-raster-and-vector-using-matplotlib-and/m-p/1144573#M63780</link>
    <description>&lt;P&gt;Can you point to an example on their examples page?&lt;/P&gt;&lt;P&gt;&lt;A href="https://matplotlib.org/stable/gallery/" target="_blank"&gt;Examples — Matplotlib 3.5.1 documentation&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Feb 2022 13:16:44 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-02-16T13:16:44Z</dc:date>
    <item>
      <title>Overlay raster and vector using matplotlib and faceting</title>
      <link>https://community.esri.com/t5/python-questions/overlay-raster-and-vector-using-matplotlib-and/m-p/1144570#M63778</link>
      <description>&lt;P&gt;I'm using the function imshow from matplotlib to display several rasters using faceting. I need to overlay the vector vec.shp on each raster in each facet. I would prefere to do this with matplotlib and imshow due to the easiness of coding&lt;/P&gt;&lt;PRE&gt;import matplotlib.pyplot as plt
import gdal
import geopandas as gpd

raster1 = gdal.Open("/path/file1.tif")
raster1 = gdal.Open("/path/file2.tif")
raster1 = gdal.Open("/path/file3.tif")
# etc

vector = gpd.read_file("/path/vec.shp")

# plot 1
plt.subplot(2, 4, 1)
plt.imshow(raster1)

# plot 2 
plt.subplot(2, 4, 2)
plt.imshow(raster2)

# plot 3
plt.subplot(2, 4, 3)
plt.imshow(raster3)

# etc&lt;/PRE&gt;&lt;P&gt;I'm wondering wether is there a syntax&lt;A href="https://www.olansiru.com/" target="_self"&gt;&amp;nbsp;&lt;/A&gt;&amp;nbsp;Like this&lt;/P&gt;&lt;PRE&gt;# plot 1
plt.subplot(2, 4, 1)
plt.imshow(raster1, vector)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 10:01:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overlay-raster-and-vector-using-matplotlib-and/m-p/1144570#M63778</guid>
      <dc:creator>ImranJaffery</dc:creator>
      <dc:date>2022-02-17T10:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay raster and vector using matplotlib and faceting</title>
      <link>https://community.esri.com/t5/python-questions/overlay-raster-and-vector-using-matplotlib-and/m-p/1144573#M63780</link>
      <description>&lt;P&gt;Can you point to an example on their examples page?&lt;/P&gt;&lt;P&gt;&lt;A href="https://matplotlib.org/stable/gallery/" target="_blank"&gt;Examples — Matplotlib 3.5.1 documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 13:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/overlay-raster-and-vector-using-matplotlib-and/m-p/1144573#M63780</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-16T13:16:44Z</dc:date>
    </item>
  </channel>
</rss>

