Plot 为什么我的图中的点被一个盒子包围?

Plot 为什么我的图中的点被一个盒子包围?,plot,octave,Plot,Octave,我有以下脚本: clear; clc close all # input samples samples = rand(100,2); # gaussian mean and covariance mu = mean(samples); sigma = cov(samples); # define a 2D grid x1 = -3:.2:3; x2 = -3:.2:3; [X1,X2] = meshgrid(x1,x2); X = [X1(:) X2(:)]; # evaluate t

我有以下脚本:

clear; clc
close all

# input samples
samples = rand(100,2);

# gaussian mean and covariance
mu = mean(samples);
sigma = cov(samples);

# define a 2D grid
x1 = -3:.2:3;
x2 = -3:.2:3;
[X1,X2] = meshgrid(x1,x2);
X = [X1(:) X2(:)];

# evaluate the pdf at the grid points
y = mvnpdf(X,mu,sigma);
y = reshape(y,length(x2),length(x1));

# plot iso-contours
contour(x1,x2,y,[0.0001 0.001 0.01 0.05 0.15 0.25 0.35])
xlabel('x')
ylabel('y')
line([0 0 1 1 0],[1 0 0 1 1],'Linestyle','--','Color','k')

# plot samples
hold on
plot(samples(:,1),samples(:,2),'+')
如果我运行它,这是我得到的输出:

这基本上是好的,除了绘制的点是由一个长方体构成的。出于美观的原因,我想把那个盒子拿走


请问,有人能告诉我怎么做吗?

这不是一个答案,因为注释中已经回答了这个问题,但写这篇文章作为一个答案,因为很难在注释中添加代码

我只是想说,既然你提到了“美学”,你通常可以用最少的额外努力在你的图形展示中做出很大的改变。例如

clear; clc; clf
figure(1)

# input samples
samples = rand(100,2);

# gaussian mean and covariance
mu = mean(samples);
sigma = cov(samples);

# define a 2D grid
x1 = -3:.2:3;
x2 = -3:.2:3;
[X1,X2] = meshgrid(x1,x2);
X = [X1(:) X2(:)];

# evaluate the pdf at the grid points
y = mvnpdf(X,mu,sigma);
y = reshape(y,length(x2),length(x1));

# plot iso-contours
contour(x1,x2,y,[0.0001 0.001 0.01 0.05 0.15 0.25 0.35], 'linewidth', 3);
set(gcf, 'color', [0.75,0.75,0.75]);
set(gca, 'color', 'k');
xlabel('x')
ylabel('y')

# plot samples
hold on
h = plot(samples(:,1),samples(:,2), 'o', 'markerfacecolor', [0, 0.6, 1], ...
         'markeredgecolor', [0, .4, .8], 'linewidth', 1.5, 'markersize', 7);
axis tight auto equal square;

你说的是盒子,你用线条画自己。。。?