question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return plots from different functions and replot as subplots

See original GitHub issue

Hi @marcomusy

I’ve two plots generated from different functions funa and funb.

def funa():
      ....
      plt1 = plt.show()

def funb():
      ....
      plt2 = plt.show()

plt1 = funa()
plt2 = funb()

I would like to plot plt1 and plt2 in a single figure as subplots. Could you please give some hints on how to do this? Can I do the following?

...
plt.show(plt1, at=0)
plt.show(plt2, at=1)

Thanks so much

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marcomusycommented, Mar 6, 2021

Cool! one extra thing you can do is to set a larger window with Plotter(size=()), depending on the physical size of your screen…

1reaction
DeepaMahmcommented, Mar 6, 2021

Hi @marcomusy ,

I noticed when

  1. settings.screeshotScale = # any value >1 subplots in a figure overlap
  2. settings.screeshotLargeImage = False creates a blank image while saving the screenshots.

settings.screeshotScale = 1
settings.screeshotLargeImage = True

solved the issues reported above 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using plots returned from functions as subplots in Python
In my code I have two functions that have more than one output each one. Those functions give as return, for example, the...
Read more >
17. Creating Subplots in Matplotlib | Numerical Programming
This function returns a figure and an Axes object or an array of Axes ... with two subplots on top of each other...
Read more >
Matplotlib Subplots - How to create multiple plots in same ...
1. Basic Overview · 2. Create a plot inside another plot using axes() · 3. Explicitly create the figure and then do add_axes()...
Read more >
Creating multiple subplots using plt.subplots - Matplotlib
A figure with just one subplot​​ subplots() without arguments returns a Figure and a single Axes . This is actually the simplest and...
Read more >
Matplotlib - Subplots() Function - Tutorialspoint
The function returns a figure object and a tuple containing axes objects equal to nrows*ncols. Each axes object is accessible by its index....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found