Error in contour dependent on number of specified levels

2 次查看(过去 30 天)
I have a matrix named ch1 that contains no inf or nan elements. The matrix has the X label time, and Y label marks. When I try to make a contour plot using:
contour(time,marks, ch1,15,'fill','on');
I get the following error:
Error using patch
Color value contains NaN, or element out of range 0.0 <= value <= 1.0
Error in specgraph.contourgroup/refresh>LdrawFilled (line 403)
cu=patch(xp,yp,clev,'FaceColor','flat','UserData',lev,patchpairs{:});
Error in specgraph.contourgroup/refresh (line 207)
LdrawFilled(this);
Error in specgraph.contourgroup/schema>LdoDirtyAction (line 265)
refresh(h);
The error disappears if I specify 16 or 20 levels rather than 15, but I still get the error when specifying 14 or 10 levels. There is no dependence on XData, YData, or the filled option. This must be some kind of bug in contour, since the error is dependent on the number of contour levels. I could provide the offending matrix if anyone is interested.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by