2D plot with linked Nan values
Show older comments
I have one vector with 32 latitude points, and another vector with sodium values for each point, but the point number 10 is a Nan value. So, I have to plot them as x=latitude and y=sodium, and I do not want the gap betwen point 9 and 11, but a connection.
I already tried this code
plot(latitude,sodium)
ln=plot(latitude,sodium);
ln.Color=[0 0 0];
ln.LineWidth=1.5;
ln.Marker="o";
ln.MarkerFaceColor=[0 0 0];
x = [latitude 9, latitude 11];
y = [sodium 9, sodium 11];
plot(latitude,sodium,"k",x,y,"k")
it worked but at one point it did not work anymore (I have a 2D line but without marker).
So I changed the last three lines and tried with this code
y1=sodium(~isnan(sodium);
x1=latitude(~isnan(sodium));
Also in this case in worked at the beginning, but now it doesn't work anymore.
How is ti possible that they stopped to work and how can I connect the gap?
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
