I would like to plot 2D streamlines using m_map projection, can anyone please help me with this? Thanks!
3 views (last 30 days)
Show older comments
Dear users, I have a 2D velocity field and I would like to visualise with streamlines in a Mercator map projection (I want to have the sea-surface currents in the Sicily Channel). I am using the following matlab code:
1.fig=figure('Units','normalized','outerposition', [0 0 0.35 0.6]);
2.region=[11.5 16. 35.5 39.]; %latitude and longitude range
3.m_proj('mercator', 'lon',[region(1) region(2)],'lat',[region(3) region(4)]);
4.streamline(x,y,u,v,x(1:3:end,1:3:end),y(1:3:end,1:3:end));
5.m_grid('box','fancy','tickdir','off');
6.m_gshhs_i('patch',[0.8 0.8 0.8],'edgecolor','k');
x,y being given by a meshgrid of the latitude and longitude range of interest.
When I run the script, I end up with a blank map showing only the coastlines of my region and I don't get any streamline of my vector field. However, if I only run the command 4, I get a nice streamline field, coherent with the expected oceanic structures of my region. Can anyone please help me with this issue? Looking forward to reading your suggestions!
CHEERS!
Daniele
1 Comment
Kelsey Brunner
on 11 Oct 2017
Hi Daniele,
Just wondering if you ever figured out how to plot streamlines on an m_map projection? I'm currently dealing with the same problem.
Thanks! - Kelsey
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!