Skip to content
Advertisement

How to put the legend outside the plot

I have a series of 20 plots (not subplots) to be made in a single figure. I want the legend to be outside of the box. At the same time, I do not want to change the axes, as the size of the figure gets reduced.

  1. I want to keep the legend box outside the plot area (I want the legend to be outside at the right side of the plot area).
  2. Is there a way to reduce the font size of the text inside the legend box, so that the size of the legend box will be small?

Advertisement

Answer

JavaScript

Enter image description here

  • fontsize='xx-small' also works, without importing FontProperties.
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement