MATLAB Answers

Plot not showing up for last section when publishing

13 views (last 30 days)
Zoe Altenberg
Zoe Altenberg on 3 Apr 2021
Answered: Uday Pradhan on 26 May 2021
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 Comments
Daniel Poiesz
Daniel Poiesz on 18 Apr 2021
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.

Sign in to comment.

Answers (1)

Uday Pradhan
Uday Pradhan on 26 May 2021
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.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!