Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MATLAB R2019a won';不显示基本线的图例_Matlab_Legend_Matlab Figure_Figure - Fatal编程技术网

MATLAB R2019a won';不显示基本线的图例

MATLAB R2019a won';不显示基本线的图例,matlab,legend,matlab-figure,figure,Matlab,Legend,Matlab Figure,Figure,我最近更改为Matlab(R2019)的新版本,当我尝试在图形上添加图例时,我得到以下错误: “”输入的大小必须相同,或者其中一个可以是标量。“” 我正在使用的代码(在以前的Matlab版本中非常有用)如下: 这是我在R2019版本中得到的: 这就是我在旧版本R2017b中得到的 其中,ph_f、ph_fb、ph_ft是原始1X1线 有人能帮我吗?我找不到解决方案。参数{'Escape time distribution',['Power-law fit,z='num2str(-zfTail

我最近更改为Matlab(R2019)的新版本,当我尝试在图形上添加图例时,我得到以下错误:

“”输入的大小必须相同,或者其中一个可以是标量。“”

我正在使用的代码(在以前的Matlab版本中非常有用)如下:

这是我在R2019版本中得到的:

这就是我在旧版本R2017b中得到的

其中,ph_f、ph_fb、ph_ft是原始1X1线
有人能帮我吗?我找不到解决方案。

参数
{'Escape time distribution',['Power-law fit,z='num2str(-zfTail,2)],'Initial distribution'}
应该直接插入到行对象之后。以下方面应起作用:

hleg = legend([ph_f, ph_fb, ph_ft], {'Escape time distribution', ['Power-law fit, z = ' num2str(-zfTail,2)], 'Initial distribution'});
hleg.FontSize = 14;
hleg.Location = 'southwest';

我不知道为什么不能在R2019a的同一行中包含
FontSize
Location
legend
属性。

很抱歉,我刚刚测试了它,它似乎再次在Matlab R2019a上不起作用。嗨@Jokerp,我错了,我使用的是R2019b。我发现了R2019a的问题,并更新了我的帖子。
hleg = legend([ph_f, ph_fb, ph_ft], {'Escape time distribution', ['Power-law fit, z = ' num2str(-zfTail,2)], 'Initial distribution'});
hleg.FontSize = 14;
hleg.Location = 'southwest';