Azzera filtri
Azzera filtri

Error plotting distribution on top of pcolor

1 visualizzazione (ultimi 30 giorni)
I'm trying to plot distribution data from csv on top of a pcolor plot
close all, clear all clc
% note I've renamed the files, call them what you like but they need to
% have the year in them to load in a loop
fp = 'C:\Users\Madison-Riley\Downloads';
ncdisp(fullfile(fp,'FinalJune2021.nc'))
%look at one file to interrogate and understand dimensions and variables
% test=ncread([filepath,'June2021.nc'],'uo'); whos test
% check all your files, June2019 only had one timestep so I couldn't work with that??
% same for June2020
time = ncread(fullfile(fp,'FinalJune2021.nc'),'time'); whos time
ntime=length(time);
% get coordinate data, assuming it's the same between all files
lon=ncread(fullfile(fp,'FinalJune2021.nc'),'longitude');
lat=ncread(fullfile(fp,'FinalJune2021.nc'),'latitude');
[LON,LAT]=meshgrid(lon,lat);
utide=ncread(fullfile(fp,'FinalJune2021.nc'),'utide'); whos utide
% dimensions lon*lat*depth*time
% https://uk.mathworks.com/help/matlab/ref/ncread.html
% try different depth layers here, why is the land extent so different?
utest=ncread(fullfile(fp,'FinalJune2021.nc'),'utide',[1 1 1 1],[length(lon) length(lat) 1 1]);
vtest=ncread(fullfile(fp,'FinalJune2021.nc'),'vtide',[1 1 1 1],[length(lon) length(lat) 1 1]);
uvtest=sqrt(utest.^2 + vtest.^2);
colormapeditor
close all
pcolor(LON,LAT,uvtest.'), shading flat, colorbar
sid=readtable('SIARC_ND_LatandLon.csv')
C = sid.Longitude
M= sid.Latitude
A=sid.No_Individuals
geoshow(sid.Longitude, sid.Latitude,sid.No_Individuals 'DisplayType', 'Point', 'Marker', 'o', 'Color', 'red');
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
geoscatter(sid.Latitude , sid.Longitude, A)

Risposta accettata

Voss
Voss il 28 Lug 2023
geoshow(sid.Longitude, sid.Latitude,sid.No_Individuals 'DisplayType', 'Point', 'Marker', 'o', 'Color', 'red');
% ^ missing comma
  3 Commenti
Voss
Voss il 28 Lug 2023
Modificato: Voss il 28 Lug 2023
You have 'texturemap' and 'Point' as the 'DisplayType'. It can't be both.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by