How to plot a contourf without the lines

4 visualizaciones (últimos 30 días)
Nick van der maat
Nick van der maat el 11 de Mayo de 2015
Comentada: Thomas Koelen el 11 de Mayo de 2015
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 ?

Respuestas (1)

Thomas Koelen
Thomas Koelen el 11 de Mayo de 2015
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 comentarios
Nick van der maat
Nick van der maat el 11 de Mayo de 2015
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 el 11 de Mayo de 2015
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?

Iniciar sesión para comentar.

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by