Filter löschen
Filter löschen

Error plotting distribution on top of pcolor

1 Ansicht (letzte 30 Tage)
Madison
Madison am 28 Jul. 2023
Kommentiert: Madison am 29 Jul. 2023
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)

Akzeptierte Antwort

Voss
Voss am 28 Jul. 2023
geoshow(sid.Longitude, sid.Latitude,sid.No_Individuals 'DisplayType', 'Point', 'Marker', 'o', 'Color', 'red');
% ^ missing comma
  3 Kommentare
Voss
Voss am 28 Jul. 2023
Bearbeitet: Voss am 28 Jul. 2023
You have 'texturemap' and 'Point' as the 'DisplayType'. It can't be both.
Madison
Madison am 29 Jul. 2023
Thank you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by