How to plot a contourf without the lines

3 次查看(过去 30 天)
Hello,
I am using contourf for a plot, but when i set de color distribution on 15 or more its almost invisible due all the lines next to each other.
Is there some code to show it without the contour lines ?

回答(1 个)

Thomas Koelen
Thomas Koelen 2015-5-11
Hallo Nick,
Een contour plot is letterlijk een "omlijning" plot, dus dat zou niet erg handig zijn ;)! Maar gelukkig zijn er andere oplossingen.
kijk bijvoorbeeld hier naar:
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
% surface in 3D
figure;
surf(Z,'EdgeColor','None');
% 2D map using view
figure;
surf(Z,'EdgeColor','None');
view(2);
en nu kunnen we de plot in 2d laten zien:
Thomas
  6 个评论
Nick van der maat
Nick van der maat 2015-5-11
figure
hist3([MAIN_EngSpeed MAIN_EngPercentLoadAtCurrentSpeed],[40 20])
title(' Engine Speed - Engine percent load (probability density distribution)');
xlabel('Engine Speed [rpm]');
ylabel('Engine percent load at current speed [%]');
%set(gcf,'renderer','opengl');
set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');
colorbar
figure
hist3([MAIN_EngSpeed(MAIN_EngSpeed>600) MAIN_EngPercentLoadAtCurrentSpeed(MAIN_EngSpeed>600)],[40 20])
[N,C]=hist3([MAIN_EngSpeed(MAIN_EngSpeed>600) MAIN_EngPercentLoadAtCurrentSpeed(MAIN_EngSpeed>600)],[40 20]);
title(' Engine Speed - Engine percent load (probability density distribution)');
xlabel('Engine Speed [rpm]');
ylabel('Engine percent load at current speed [%]');
set(gcf,'renderer','opengl');
set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');
colorbar
%%%Contour plot
figure
contourf(C{1},C{2},N',15);
title(' Engine Speed - Engine percent load (probability density distribution)');
xlabel('Engine Speed [rpm]');
ylabel('Engine percent load at current speed [%]');
colorbar
Thomas Koelen
Thomas Koelen 2015-5-11
Dus wat is nu precies je probleem? hoe wil je je data graag laten zien? En kun je misschien een plaatje laten zien van hoe het er nu uit ziet?

请先登录,再进行评论。

类别

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