Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8173599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:13:09+00:00 2026-06-06T22:13:09+00:00

plotting module def plotGraph(X,Y): fignum = random.randint(0,sys.maxint) plt.figure(fignum) ### Plotting arrangements ### return fignum

  • 0

plotting module

def plotGraph(X,Y):
    fignum = random.randint(0,sys.maxint)
    plt.figure(fignum)
    ### Plotting arrangements ###
    return fignum

main module

import matplotlib.pyplot as plt
### tempDLStats, tempDLlabels are the argument
plot1 = plotGraph(tempDLstats, tempDLlabels)
plot2 = plotGraph(tempDLstats_1, tempDLlabels_1)
plot3 = plotGraph(tempDLstats_2, tempDLlabels_2)
plt.show()

I want to save all the graphs plot1, plot2, plot3 to a single PDF file. Is there any way to achieve it? I can’t include the plotGraph function in the main module.

There’s a function named pyplot.savefig but that seems to work only with a single figure. Is there any other way to accomplish it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:13:10+00:00Added an answer on June 6, 2026 at 10:13 pm

    Never mind got the way to do it.

    def plotGraph(X,Y):
         fignum = random.randint(0,sys.maxint)
         fig = plt.figure(fignum)
         ### Plotting arrangements ###
         return fig
    

    —— plotting module ——

    —– mainModule —-

     import matplotlib.pyplot as plt
     ### tempDLStats, tempDLlabels are the argument
     plot1 = plotGraph(tempDLstats, tempDLlabels)
     plot2 = plotGraph(tempDLstats_1, tempDLlabels_1)
     plot3 = plotGraph(tempDLstats_2, tempDLlabels_2)
     plt.show()
     plot1.savefig('plot1.png')
     plot2.savefig('plot2.png')
     plot3.savefig('plot3.png')
    

    —– mainModule —–

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When plotting on a figure in MATLAB, I have noticed that parts of the
Is there a good Python module for plotting Gantt Charts ? I've tried CairoPlot
I'm plotting the figure below using R's plot() function. It is a plot of
I am plotting two curves in different axes in the same figure with plotyy.
When plotting color-maps using gnuplot, I usually use the following lines: ... set palette
When plotting a graph with a discontinuity/asymptote/singularity/whatever, is there any automatic way to prevent
I am plotting boxplots from this data: MY_LABEL MY_REAL MY_CATEGORY 1 [POS] .56 POS
I'm plotting data in Python using matplotlib. I am updating the data of the
I'm plotting some data curves with gnuplot, and they look like this: However, the
The Chaco plotting toolkit for Python includes examples that show how to dynamically update

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.