Matlab中plotpc的不同颜色线 [英] Different color line with plotpc in matlab

查看:497
本文介绍了Matlab中plotpc的不同颜色线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在绘制两个plotpc图表(我想查看感知器和贝叶斯网络的决策边界),我需要它们具有不同的颜色.

I am plotting two plotpc charts (i want to see decision boundaries from perceptron and from Bayesian net) and I need them to have different color.

plotpv(P,T);
hold all;
plotpc(net.IW{1,1},0,'r');
plotpc([w1(maxind(1)), w2(maxind(2))],0,'g');
title('Decision boundaries');

但是我所有的试验都以失败告终,我总是得到相同的颜色:

However all my trials ended up with failure and I always get same colors like this:

感谢您的帮助.

推荐答案

您需要将plotpc(行句柄)的输出分配给某个变量,然后您可以使用该变量来更改行的外观,例如

You need to assign the output of plotpc (line handle) to some variable, which you can then use to alter line appearance, e.g.

hPlot = plotpc(net.IW{1,1},0);
set(hPlot, 'Color', 'r');

此外,我不认为plotpc接受颜色作为第三个参数-这样做时您应该得到警告.

Also, I don't think plotpc accepts a color as a third argument - you should get a warning when you do that.

这篇关于Matlab中plotpc的不同颜色线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆