There is a Floating Bar Plot in the Simulink Extras->Additional Sinks library. However, it has very limited functionality.
The best way to do this is to write an (m-code) S-Function. Although not difficult, it's not going to be trivial to do properly. Within the S-Function you'll need to do things like
- initialize a figure window and an axes on it, and open the figure if it is still open (from a previous simulation).
- update the plot (efficiently, and most likely using low level functions, not the
bar
function itself) - check that the user hasn't closed the figure, and only plot data if it hasn't (or reopen the figure if it has been closed).
You will most likely also need to use some of the block callbacks to do the right thing if the block is deleted (e.g. delete the figure too, if it's still open), copied, etc.