This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
other:python:jyp_steps [2019/05/27 09:39] jypeter [Useful reference pages] Added 'text' |
other:python:jyp_steps [2019/05/28 09:38] jypeter [Useful reference pages] added link to advanced legend guide |
||
---|---|---|---|
Line 233: | Line 233: | ||
* ''fontsize'': size in points, or (better!) string specifying a relative size (''xx-small'', ''x-small'', ''small'', ''medium'', ''large'', ''x-large'', ''xx-large'') | * ''fontsize'': size in points, or (better!) string specifying a relative size (''xx-small'', ''x-small'', ''small'', ''medium'', ''large'', ''x-large'', ''xx-large'') | ||
* [[https://matplotlib.org/api/text_api.html#matplotlib.text.Text|all the text properties]] | * [[https://matplotlib.org/api/text_api.html#matplotlib.text.Text|all the text properties]] | ||
- | * [[https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.legend|legend(...)]] ([[https://matplotlib.org/examples/pylab_examples/legend_demo3.html|legend demo]]) | + | * [[https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.legend|legend(...)]] ([[https://matplotlib.org/examples/pylab_examples/legend_demo3.html|legend demo]], [[https://matplotlib.org/users/legend_guide.html|advanced legend guide]]) |
* The legend will //show// the lines (or other objects) that were associated with a //label// with the ''label='' keyword when creating/updating a plot | * The legend will //show// the lines (or other objects) that were associated with a //label// with the ''label='' keyword when creating/updating a plot | ||
* If there are some elements of a plot that you do not want to associate with a legend (e.g. there are several lines with the same color and markers, but you want to plot the legend only once), do not specify a ''label='' keyword for these elements, or add a ''_'' at the front of the label strings | * If there are some elements of a plot that you do not want to associate with a legend (e.g. there are several lines with the same color and markers, but you want to plot the legend only once), do not specify a ''label='' keyword for these elements, or add a ''_'' at the front of the label strings |