Showing posts with label Option. Show all posts
Showing posts with label Option. Show all posts

Combine multiple line plot and contour plot with a colorbar using Python and matplotlib.pyplot


The result is:
Combine multiple line plot and contour plot with a colorbar using Python and matplotlib.pyplot

This code shows how to combine multiple line plots and contour plots with a colorbar in one figure using Python and matplotlib.pyplot. To combine these plots, plt.subplots with gridspec_kw options are used. The xlims are also adjusted between upper and lower plots.

Try all legend options in Python Matplotlib.pyplot


The default legend is:

Try all legend options - default result -

In this page, all legend options are tried.

Change the space between labels and lines of the legend in Python Matplotlib.pyplot


The result is:

Legend with changing padding between line and label using handletextpad option

This page how to change the space between the lines in legend and their labels.

The effect of pad_inches in Python Matplotlib.pyplot


The results are:





This page shows how to change pad_inches and how it affect on the saved figure in python and matplotlib.pyplot.