<?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 conversion 2D raster to 3D in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/conversion-2d-raster-to-3d/m-p/1538726#M88287</link>
    <description>&lt;P&gt;I am trying to generate a map with a 2D raster as basemap (observed landuse) and overlay it with 3D error bars (containing the incorrect land use categories that model predicted). So it involves conversion of one of the 2D files to 3D first&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying both in arcgis pro and arc scene&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In Arc Scene I first created a height column in attribute table as the raster doesn't have elevation information. when I tried this &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/how-can-i-display-2d-raster-data-as-a-3d-surface/m-p/1277643" target="_self"&gt;link&lt;/A&gt; and increased the value of vertical exaggeration, it also changed the 2D base map which I wanted to keep as it is.&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/how-can-i-display-2d-raster-data-as-a-3d-surface/m-p/1277643" target="_blank" rel="noopener"&gt;&lt;BR /&gt;&lt;/A&gt;&lt;P&gt;I am looking to get something like the map at the bottom but the vertical bars come from a different raster with the same spatial boundary as base map&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The python code I have been using looks like below and it gives me a map skipping the basemap completely and very high error bars. I am trying to figure out what am I missing&amp;nbsp;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;/P&gt;&lt;P&gt;import numpy as np&lt;/P&gt;&lt;P&gt;import matplotlib.pyplot as plt&lt;/P&gt;&lt;P&gt;from matplotlib.colors import ListedColormap&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;from mpl_toolkits.mplot3d import Axes3D&amp;nbsp; # Import for 3D plotting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Switch to 'Agg' backend for non-interactive use, better for saving figures&lt;/P&gt;&lt;P&gt;import matplotlib&lt;/P&gt;&lt;P&gt;matplotlib.use('Agg')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Input file paths&lt;/P&gt;&lt;P&gt;raster_a_path = r"C:\Users\xyz\ xyz \ xyz \ xyz \ xyz.tif"&lt;/P&gt;&lt;P&gt;raster_c_path = r"C:\ Users\xyz\ xyz \ xyz \ xyz \ xyz.tif"&lt;/P&gt;&lt;P&gt;csv_path = r"C:\ Users\xyz\ xyz \ xyz \ xyz \ xyz.csv"&lt;/P&gt;&lt;P&gt;output_folder = r"C:\ Users\xyz\ xyz \ xyz \ xyz \ xyz”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Load the CSV file containing land use types and colors&lt;/P&gt;&lt;P&gt;legend_df = pd.read_csv(csv_path)&lt;/P&gt;&lt;P&gt;legend_df['LandUseType'] = legend_df['LandUseType'].str.strip()&amp;nbsp; # Clean up data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Ensure all color codes are valid hexadecimal&lt;/P&gt;&lt;P&gt;def validate_color(color):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if isinstance(color, str) and color.startswith('#') and len(color) == 7:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int(color[1:], 16)&amp;nbsp; # Try converting from hex to RGB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except ValueError:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;legend_df = legend_df[legend_df['Color'].apply(validate_color)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Convert values and colors to a dictionary&lt;/P&gt;&lt;P&gt;value_to_color = dict(zip(legend_df['Value'], legend_df['Color']))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Convert colors to RGB tuples for use with matplotlib, adjust brightness for 3D bars&lt;/P&gt;&lt;P&gt;colors_rgb = [tuple(min(int(color.strip("#")[i:i+2], 16) / 255.0 * 1.5, 1.0) for i in (0, 2, 4)) for color in legend_df['Color']]&lt;/P&gt;&lt;P&gt;cmap = ListedColormap(colors_rgb)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Load raster datasets&lt;/P&gt;&lt;P&gt;raster_a = arcpy.Raster(raster_a_path)&lt;/P&gt;&lt;P&gt;raster_c = arcpy.Raster(raster_c_path)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Convert raster_a and raster_c to NumPy arrays&lt;/P&gt;&lt;P&gt;raster_a_array = arcpy.RasterToNumPyArray(raster_a)&lt;/P&gt;&lt;P&gt;raster_c_array = arcpy.RasterToNumPyArray(raster_c)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Check if dimensions match&lt;/P&gt;&lt;P&gt;if raster_a_array.shape != raster_c_array.shape:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise ValueError(f"Dimensions of raster_a ({raster_a_array.shape}) and raster_c ({raster_c_array.shape}) do not match")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Mask NoData values (-9999) in raster_a&lt;/P&gt;&lt;P&gt;no_data_value = -9999&lt;/P&gt;&lt;P&gt;raster_a_masked = np.ma.masked_equal(raster_a_array, no_data_value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Adjust extent based on the raster's spatial reference&lt;/P&gt;&lt;P&gt;extent = [raster_a.extent.XMin, raster_a.extent.XMax, raster_a.extent.YMin, raster_a.extent.YMax]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Plot Raster A in 2D&lt;/P&gt;&lt;P&gt;fig = plt.figure(figsize=(10, 10))&lt;/P&gt;&lt;P&gt;ax_2d = fig.add_subplot(111)&lt;/P&gt;&lt;P&gt;img_2d = ax_2d.imshow(raster_a_masked, cmap=cmap, extent=extent, interpolation='none')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Overlay Raster C in 3D (vertical bars)&lt;/P&gt;&lt;P&gt;ax_3d = fig.add_subplot(111, projection='3d')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Create grid for raster_c&lt;/P&gt;&lt;P&gt;x = np.arange(raster_c_array.shape[1])&lt;/P&gt;&lt;P&gt;y = np.arange(raster_c_array.shape[0])&lt;/P&gt;&lt;P&gt;x, y = np.meshgrid(x, y)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Normalize height of 3D bars to a reasonable scale&lt;/P&gt;&lt;P&gt;heights = raster_c_array / np.nanmax(raster_c_array) * 10&amp;nbsp; # Scale heights for visibility&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Plot each bar as a vertical block&lt;/P&gt;&lt;P&gt;for i in range(raster_c_array.shape[0]):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for j in range(raster_c_array.shape[1]):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if raster_c_array[i, j] != no_data_value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ax_3d.bar3d(x[i, j], y[i, j], 0, 1, 1, heights[i, j],&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color=cmap(raster_c_array[i, j] % len(colors_rgb)), alpha=0.5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Set aspect ratios and remove the 3D axis, background grids, and labels&lt;/P&gt;&lt;P&gt;ax_3d.set_axis_off()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Set the view angle for 3D projection&lt;/P&gt;&lt;P&gt;ax_3d.view_init(elev=50, azim=-60)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Pause to ensure rendering completes before saving&lt;/P&gt;&lt;P&gt;plt.draw()&lt;/P&gt;&lt;P&gt;plt.pause(0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Construct the full path for saving the plot&lt;/P&gt;&lt;P&gt;output_path = os.path.join(output_folder, "output_base_map_with_3D_overlay.png")&lt;/P&gt;&lt;P&gt;# Save the plot to the specified folder&lt;/P&gt;&lt;P&gt;plt.savefig(output_path, bbox_inches='tight', dpi=300)&lt;/P&gt;&lt;P&gt;print(f"Plot saved successfully to: {output_path}")&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="RakhshindaBano_1-1726418429948.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115133i7A591E9C5A36FD4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RakhshindaBano_1-1726418429948.png" alt="RakhshindaBano_1-1726418429948.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Sun, 15 Sep 2024 16:50:19 GMT</pubDate>
    <dc:creator>RakhshindaBano</dc:creator>
    <dc:date>2024-09-15T16:50:19Z</dc:date>
    <item>
      <title>conversion 2D raster to 3D</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/conversion-2d-raster-to-3d/m-p/1538726#M88287</link>
      <description>&lt;P&gt;I am trying to generate a map with a 2D raster as basemap (observed landuse) and overlay it with 3D error bars (containing the incorrect land use categories that model predicted). So it involves conversion of one of the 2D files to 3D first&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying both in arcgis pro and arc scene&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In Arc Scene I first created a height column in attribute table as the raster doesn't have elevation information. when I tried this &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/how-can-i-display-2d-raster-data-as-a-3d-surface/m-p/1277643" target="_self"&gt;link&lt;/A&gt; and increased the value of vertical exaggeration, it also changed the 2D base map which I wanted to keep as it is.&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/how-can-i-display-2d-raster-data-as-a-3d-surface/m-p/1277643" target="_blank" rel="noopener"&gt;&lt;BR /&gt;&lt;/A&gt;&lt;P&gt;I am looking to get something like the map at the bottom but the vertical bars come from a different raster with the same spatial boundary as base map&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The python code I have been using looks like below and it gives me a map skipping the basemap completely and very high error bars. I am trying to figure out what am I missing&amp;nbsp;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;/P&gt;&lt;P&gt;import numpy as np&lt;/P&gt;&lt;P&gt;import matplotlib.pyplot as plt&lt;/P&gt;&lt;P&gt;from matplotlib.colors import ListedColormap&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;from mpl_toolkits.mplot3d import Axes3D&amp;nbsp; # Import for 3D plotting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Switch to 'Agg' backend for non-interactive use, better for saving figures&lt;/P&gt;&lt;P&gt;import matplotlib&lt;/P&gt;&lt;P&gt;matplotlib.use('Agg')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Input file paths&lt;/P&gt;&lt;P&gt;raster_a_path = r"C:\Users\xyz\ xyz \ xyz \ xyz \ xyz.tif"&lt;/P&gt;&lt;P&gt;raster_c_path = r"C:\ Users\xyz\ xyz \ xyz \ xyz \ xyz.tif"&lt;/P&gt;&lt;P&gt;csv_path = r"C:\ Users\xyz\ xyz \ xyz \ xyz \ xyz.csv"&lt;/P&gt;&lt;P&gt;output_folder = r"C:\ Users\xyz\ xyz \ xyz \ xyz \ xyz”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Load the CSV file containing land use types and colors&lt;/P&gt;&lt;P&gt;legend_df = pd.read_csv(csv_path)&lt;/P&gt;&lt;P&gt;legend_df['LandUseType'] = legend_df['LandUseType'].str.strip()&amp;nbsp; # Clean up data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Ensure all color codes are valid hexadecimal&lt;/P&gt;&lt;P&gt;def validate_color(color):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if isinstance(color, str) and color.startswith('#') and len(color) == 7:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int(color[1:], 16)&amp;nbsp; # Try converting from hex to RGB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except ValueError:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;legend_df = legend_df[legend_df['Color'].apply(validate_color)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Convert values and colors to a dictionary&lt;/P&gt;&lt;P&gt;value_to_color = dict(zip(legend_df['Value'], legend_df['Color']))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Convert colors to RGB tuples for use with matplotlib, adjust brightness for 3D bars&lt;/P&gt;&lt;P&gt;colors_rgb = [tuple(min(int(color.strip("#")[i:i+2], 16) / 255.0 * 1.5, 1.0) for i in (0, 2, 4)) for color in legend_df['Color']]&lt;/P&gt;&lt;P&gt;cmap = ListedColormap(colors_rgb)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Load raster datasets&lt;/P&gt;&lt;P&gt;raster_a = arcpy.Raster(raster_a_path)&lt;/P&gt;&lt;P&gt;raster_c = arcpy.Raster(raster_c_path)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Convert raster_a and raster_c to NumPy arrays&lt;/P&gt;&lt;P&gt;raster_a_array = arcpy.RasterToNumPyArray(raster_a)&lt;/P&gt;&lt;P&gt;raster_c_array = arcpy.RasterToNumPyArray(raster_c)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Check if dimensions match&lt;/P&gt;&lt;P&gt;if raster_a_array.shape != raster_c_array.shape:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise ValueError(f"Dimensions of raster_a ({raster_a_array.shape}) and raster_c ({raster_c_array.shape}) do not match")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Mask NoData values (-9999) in raster_a&lt;/P&gt;&lt;P&gt;no_data_value = -9999&lt;/P&gt;&lt;P&gt;raster_a_masked = np.ma.masked_equal(raster_a_array, no_data_value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Adjust extent based on the raster's spatial reference&lt;/P&gt;&lt;P&gt;extent = [raster_a.extent.XMin, raster_a.extent.XMax, raster_a.extent.YMin, raster_a.extent.YMax]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Plot Raster A in 2D&lt;/P&gt;&lt;P&gt;fig = plt.figure(figsize=(10, 10))&lt;/P&gt;&lt;P&gt;ax_2d = fig.add_subplot(111)&lt;/P&gt;&lt;P&gt;img_2d = ax_2d.imshow(raster_a_masked, cmap=cmap, extent=extent, interpolation='none')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Overlay Raster C in 3D (vertical bars)&lt;/P&gt;&lt;P&gt;ax_3d = fig.add_subplot(111, projection='3d')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Create grid for raster_c&lt;/P&gt;&lt;P&gt;x = np.arange(raster_c_array.shape[1])&lt;/P&gt;&lt;P&gt;y = np.arange(raster_c_array.shape[0])&lt;/P&gt;&lt;P&gt;x, y = np.meshgrid(x, y)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Normalize height of 3D bars to a reasonable scale&lt;/P&gt;&lt;P&gt;heights = raster_c_array / np.nanmax(raster_c_array) * 10&amp;nbsp; # Scale heights for visibility&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Plot each bar as a vertical block&lt;/P&gt;&lt;P&gt;for i in range(raster_c_array.shape[0]):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for j in range(raster_c_array.shape[1]):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if raster_c_array[i, j] != no_data_value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ax_3d.bar3d(x[i, j], y[i, j], 0, 1, 1, heights[i, j],&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color=cmap(raster_c_array[i, j] % len(colors_rgb)), alpha=0.5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Set aspect ratios and remove the 3D axis, background grids, and labels&lt;/P&gt;&lt;P&gt;ax_3d.set_axis_off()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Set the view angle for 3D projection&lt;/P&gt;&lt;P&gt;ax_3d.view_init(elev=50, azim=-60)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Pause to ensure rendering completes before saving&lt;/P&gt;&lt;P&gt;plt.draw()&lt;/P&gt;&lt;P&gt;plt.pause(0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Construct the full path for saving the plot&lt;/P&gt;&lt;P&gt;output_path = os.path.join(output_folder, "output_base_map_with_3D_overlay.png")&lt;/P&gt;&lt;P&gt;# Save the plot to the specified folder&lt;/P&gt;&lt;P&gt;plt.savefig(output_path, bbox_inches='tight', dpi=300)&lt;/P&gt;&lt;P&gt;print(f"Plot saved successfully to: {output_path}")&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="RakhshindaBano_1-1726418429948.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115133i7A591E9C5A36FD4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RakhshindaBano_1-1726418429948.png" alt="RakhshindaBano_1-1726418429948.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sun, 15 Sep 2024 16:50:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/conversion-2d-raster-to-3d/m-p/1538726#M88287</guid>
      <dc:creator>RakhshindaBano</dc:creator>
      <dc:date>2024-09-15T16:50:19Z</dc:date>
    </item>
  </channel>
</rss>

