Skip to content
Advertisement

Adding a figure created in a function to another figure’s subplot

I created two functions that make two specific plots and returns me the respective figures:

JavaScript

Now, outside of my functions, I want to create a figure with two subplots and add my function figures to it. Something like this:

JavaScript

However, just allocating the created figures to this new figure does not work. The function calls the figure, but it is not allocated in the subplot. Is there a way to place my function figure in another figure’s subplot?

Advertisement

Answer

Eaiser and better to just pass your function an Axes:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement