@Sim, I see what happened - in your case you do have the Mapping Toolbox (your geobasemap is working), but the original code syntax was incorrect. Let me give you both solutions.
Solution 1: WITH Mapping Toolbox (Your Case)
Based on the MathWorks documentation for geoshow, here's the correct syntax:
% Read the image
[imgData, ~, alphaData] = imread('/MATLAB Drive/IMG_6894.PNG');
%replace it with your directory path
% Define the geographic bounds latlim = [40, 50]; lonlim = [0, 10];
% Create figure with geoaxes figure; gx = geoaxes; geobasemap(gx, 'grayland'); hold on;
% Correct geoshow syntax for geographic axes geoshow(imgData, spatialref, 'DisplayType', 'texturemap'); % OR the simpler form: h = geoshow(latlim, lonlim, imgData);
% Apply transparency if ~isempty(alphaData) set(h, 'AlphaData', alphaData); end
Why the original failed: According to the documentation, when using geoshow with GeographicAxes (created by geobasemap), the 'Parent' parameter syntax shown in that forum post is not supported. The documentation states: " geoshow is not recommended when used with geographic axes (created by geoaxes or geobasemap). Use geolimits instead to set limits."
Solution 2: WITHOUT Mapping Toolbox (Fallback)
This is what I implemented - works with base MATLAB only:
close all;clear all;clc
% Read the image
[imgData, ~, alphaData] = imread('/MATLAB Drive/IMG_6894.PNG');
% Define the geographic bounds for the image latlim = [40, 50]; lonlim = [0, 10];
% Create figure
figure('Color', 'w');
ax = axes;
% Display the image with geographic coordinates imagesc(lonlim, latlim, imgData); set(ax, 'YDir', 'normal'); % Correct the y-axis direction axis equal tight;
% Set labels
xlabel('Longitude');
ylabel('Latitude');
title('Basketball Overlay');
% Apply transparency if alphaData exists if ~isempty(alphaData) alpha(alphaData); end
% Add gridlines for reference grid on;
Output:


Since you have the Mapping Toolbox, use Solution 1 for the proper geobasemap overlay!
Let me know how it goes.




