How to plot a contourf without the lines

3 Ansichten (letzte 30 Tage)
Nick van der maat
Nick van der maat am 11 Mai 2015
Kommentiert: Thomas Koelen am 11 Mai 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 ?

Antworten (1)

Thomas Koelen
Thomas Koelen am 11 Mai 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 Kommentare
Nick van der maat
Nick van der maat am 11 Mai 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 am 11 Mai 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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by