[Matplotlib-users] host_subplot figure argument

Jerzy Karczmarczuk jerzy.karczmarczuk at unicaen.fr
Wed Jun 10 16:36:09 EDT 2020


Le 10/06/2020 à 20:15, Neal Becker a écrit :

> I tried to use host_subplot with a figure argument. *Why does this fail?*
> ------------------------
> import matplotlib.pyplot as plt
> fig,ax = plt.subplots()
> host = host_subplot(figure=fig)  ##/of course, import is missing... (JK)/
> ------------------------
> ValueError: Illegal argument(s) to subplot: ()

*/Please, why don't you read the docs?...
/*/Where have you found //the fig parameter?/*/
/*

 1. You never mention the parasite axes etc., so perhaps simple
    *add_subplot* might be convenient.
 2. Anyway, both, *subplot*, and
    *from mpl_toolkits.axes_grid1 import **host_subplot
    *share the geometry parameters, say 221 (columns, rows, which).
 3. Look e.g., here:

    *https://matplotlib.org/gallery/axisartist/demo_parasite_axes2.html?highlight=host_subplot
    *   or here:*
    https://stackoverflow.com/questions/33396190/what-are-the-parameters-of-host-subplot-in-matplotlibs-mpl-toolkits-axes-grid1

    *

And most probably a dozen more.

Jerzy Karczmarczuk
/Caen, France/



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20200610/2557e6a2/attachment.html>


More information about the Matplotlib-users mailing list