Borrar filtros
Borrar filtros

Error plotting distribution on top of pcolor

1 visualización (últimos 30 días)
Madison
Madison el 28 de Jul. de 2023
Comentada: Madison el 29 de Jul. de 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)

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by