MATLAB Answers

global legend in tiledlayout

105 views (last 30 days)
Suresh Katuwal Chhetri
Suresh Katuwal Chhetri on 9 Apr 2020
Answered: Sean de Wolski on 14 Apr 2020
I'm having a hard time to include a global legend in tiledlayout function. Does anybody has the same problem like me and have a solution?
for eg. I need to plot 2x2 plot and all of them need to have same global legend. While trying, I get my legend on a last plot!!! I want to display my legend in the southoutside of my plot (i.e. it should be at the middle of my last last two plots).
Any help or suggestion would be highly appreciated.

  0 Comments

Sign in to comment.

Answers (2)

Sean de Wolski
Sean de Wolski on 14 Apr 2020
Look at sgtitle which does exactly this.
doc sgtitle

  0 Comments

Sign in to comment.


Rajani Mishra
Rajani Mishra on 14 Apr 2020
Legend needs a axis object as a target hence it cannot be attached with tiledlayout object itself, hence creating a global legend by this method is not possible. You can modify Legend property "legend.Position" to have legend at the desired location.
Also I found a similar question where subplot is used in place of titledlayout, please refer below for the link:

  0 Comments

Sign in to comment.


Translated by