plotting a feather plot for u and v component

Hi everyone.
How can I plot a figure similar to the example below, using the nctdf data attached?
The lon (longitude) and latitude represents a small area, it would be ideal to plot exactly the point within this area which is of the following coordinates:
exactlat = 53.75129
exactlon =-5.181839
Thank you in advance for the help!

2 Comments

What have you tried so far?
Hi Adam,
Yes I have tried it but somehow it comes out like that rather than with the arrows:

Sign in to comment.

 Accepted Answer

If you zoom into your data, you'll see that you've got arrows.
load('u10.mat')
load('v10.mat')
figure();
tcl = tiledlayout(2,1);
nexttile()
feather(squeeze(u10(1,1,:)),squeeze(v10(1,1,:)))
title('full view')
nexttile()
feather(squeeze(u10(1,1,:)),squeeze(v10(1,1,:)))
xlim([ 176.83 316.27])
title('zoomed')
Perhaps you could dow-sample your data. This example plot every 5th data point. Just consider the risks (clipping out important outliers or missing trends).
figure
idx = 1 : 5 : size(u10,3);
feather(squeeze(u10(1,1,idx)),squeeze(v10(1,1,idx)))

4 Comments

I see. Thank you Adam.
How do I keep going with the code if I want to plot every 5th data point?
Will it be simply like below?
figure
idx = 5 : 10 : size(u10,3);
feather(squeeze(u10(1,1,idx)),squeeze(v10(1,1,idx)))
Also, do you know how would it be possible to plot the the max in every 5 data points, but equally distributed, using the ‘movmax’ function?. And how to plot it with like the figure below?
Sorry for all the questions but I am new to Matlab (as you can imagine) and trying to figure out the best way to plot this data. Thanks again for your help so far!
This line below plots every 10th data point starting with #5.
idx = 5 : 10 : size(u10,3)
Perhaps you'd rather use one of the following lines,
idx = 1 : 5 : size(u10,3) % [1 6 11 16,...]
idx = 5 : 5 : size(u10,3) % [5 10 15 20, ....]
We don't have a function that easily adds arrows like the one in the image you shared. You could certainly create a scatter plot using scatter to specify the color of each point. See the movmax documentation for demos to get you started on your other question. good luck!

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 9 Jun 2023

Commented:

on 19 Jun 2023

Community Treasure Hunt

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

Start Hunting!