Plot not showing up for last section when publishing
21 次查看(过去 30 天)
显示 更早的评论
I have two sections of code (each section starts with %%), they both have plots in them. When I go to publish, the first section shows the plot immediately after the section/block of code it corresponds to, but the second section doesn't produce the plot. It has something to do with the last section. I repeated the second block of code, so there were a total of 3 sections and the first two sections had plots after them but the last did not. When I run the script both/all plots are produced with no errors. In other words both code blocks are producing the right plots. It's just when I publish for some reason the last section doesn't produce a plot. I don't want to use snapnow because that puts the plots at the very end of the script and I want them to show up after their corresponding code.
Note: there is a section with a function at the very end – could this be affecting it?
2 个评论
Daniel Poiesz
2021-4-18
I am having the exact same problem. I moved my code blocks around and it is always the last one that does not display its plots. The last line of code in each of my sections are the plots, so I don't think your function can be causing the problem. I also do not want to use snapnow becaus it places the plots at the end of the document and not in the proper section.
Daniel Poiesz
2021-4-18
What is even more frustating is if I add a section at the end and plot a straight line then it works. I thought if the last one doesn't plot, then I will add a dummy plot. But then the section I was previously missing will plot followed by the dummy plot. So I can not even fool it into working.
回答(2 个)
Sarah
2024-2-3
编辑:Sarah
2024-2-3
Hello,
I had a similar issue. In my case, the last plot was taking too long to generate, so the publishing finished without it. I put in a pause() command for a few seconds after the last plot, and it was successfully displayed in the published pdf. Hope the fix helps anyone with this problem!
0 个评论
Uday Pradhan
2021-5-26
Hello,
The issue is not reproducible at my end. Could you share a snippet of code that reproduces the issue at your end? Also, please attach the MATLAB version number installed on your machine. Thanks.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!