How to plot a contourf without the lines

조회 수: 4 (최근 30일)
Nick van der maat
Nick van der maat 2015년 5월 11일
댓글: Thomas Koelen 2015년 5월 11일
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에서 Data Distribution Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by