Azzera filtri
Azzera filtri

How to plot a contourf without the lines

2 visualizzazioni (ultimi 30 giorni)
Nick van der maat
Nick van der maat il 11 Mag 2015
Commentato: Thomas Koelen il 11 Mag 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 ?

Risposte (1)

Thomas Koelen
Thomas Koelen il 11 Mag 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 Commenti
Nick van der maat
Nick van der maat il 11 Mag 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 il 11 Mag 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?

Accedi per commentare.

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by