如何防止MATLAB中的fill命令创建没有“角"的框. [英] How to prevent the fill command in MATLAB from creating boxes without "corners"

查看:89
本文介绍了如何防止MATLAB中的fill命令创建没有“角"的框.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在MATLAB中使用fill命令来创建使用'fill'命令创建的框图(实际代码基于

I am currently using the fill command in MATLAB to create a graph of boxes that were created using the 'fill' command (the actual code is based off this StackOverflow Question.

我的问题是,我创建的框没有角".我附上了说明问题的PNG.请注意,由于图像已被大量渲染,因此您必须仔细观察,尽管在此示例中,我的箭头也看起来很奇怪,因为它们也没有边缘)

My issue is that the boxes that I create do not have "corners." I am attaching a PNG that illustrates the issue. Note that you have to look a little carefully since the image was heavily rendered, though in this example my arrows also look weird since they don't have edges either)

我想知道是否有人想出什么问题了?在使用fill命令后,这些框会以这种方式立即显示,该命令具有以下结构:

I am wondering if anyone has an idea of what might be going wrong? The boxes appear this way immediately after I use the fill command, which has the following structure:

fill(X,Y,MyFaceColor,'FaceAlpha',0.5,'EdgeColor', MyEdgeColor,'LineStyle','','LineWidth',box_line_width,'EdgeAlpha',1)

推荐答案

如果未明确定义角标记,则函数fill似乎会留出空间.因此,使用marker属性调用fill将解决您的问题.但是,由于标记和线宽似乎在不同的比例下起作用,因此您必须尝试使用​​标记的大小才能获得平滑的边缘.

The function fill appears to leave space for corner markers if they are not explicitly defined. Hence, calling fill with the marker property will solve your problem. However, since markers and linewidths seem to work on different scales, you will have to play around with the marker size to get smooth edges.

示例:

fill(X,Y,'r','FaceAlpha',0.5,'EdgeColor', 'k',...
    'LineWidth', 5,'EdgeAlpha',1 , 'marker', '.', 'markersize', 15)

这篇关于如何防止MATLAB中的fill命令创建没有“角"的框.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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