how to get plots made faster

Discussion in 'Python' started by amar Singh, Mar 9, 2012.

  1. amar Singh

    amar Singh Guest

    The following is the part of my code which is running faster locally
    and more slowly remotely via ssh on the same machine. Note I am trying
    to generate a multi-page report.


    ## create plots and write to a pdf file
    from scipy import *
    import matplotlib.pyplot as plt
    from matplotlib.backends.backend_pdf import PdfPages

    # open a multi-page pdf file
    pp = PdfPages('history_plot.pdf')

    F=loadtxt('hist.dat',comments='%')


    t=F[:,0]
    E=F[:,13]

    plt.plot(t,E)

    h1=plt.ylabel('Energy', fontsize=16)
    h1=plt.xlabel('Time', fontsize=16)
    pp.savefig()

    plt.clf()
    VdotB=F[:,14]
    plt.plot(t,VdotB)

    pp.savefig()
    pp.close()
     
    amar Singh, Mar 9, 2012
    #1
    1. Advertising

  2. On 09/03/2012 04:40, amar Singh wrote:
    > The following is the part of my code which is running faster locally
    > and more slowly remotely via ssh on the same machine. Note I am trying
    > to generate a multi-page report.
    >
    >
    > ## create plots and write to a pdf file
    > from scipy import *
    > import matplotlib.pyplot as plt
    > from matplotlib.backends.backend_pdf import PdfPages
    >
    > # open a multi-page pdf file
    > pp = PdfPages('history_plot.pdf')
    >
    > F=loadtxt('hist.dat',comments='%')
    >
    >
    > t=F[:,0]
    > E=F[:,13]
    >
    > plt.plot(t,E)
    >
    > h1=plt.ylabel('Energy', fontsize=16)
    > h1=plt.xlabel('Time', fontsize=16)
    > pp.savefig()
    >
    > plt.clf()
    > VdotB=F[:,14]
    > plt.plot(t,VdotB)
    >
    > pp.savefig()
    > pp.close()


    I can't help directly but you may be better off asking on the matplotlib
    users mailing list see
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

    --
    Cheers.

    Mark Lawrence.
     
    Mark Lawrence, Mar 9, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    501
    Robert Dede
    Jun 5, 2005
  2. John Abel

    Can This Code Be Made Faster?

    John Abel, Sep 12, 2003, in forum: Python
    Replies:
    3
    Views:
    314
    Sean Ross
    Sep 12, 2003
  3. John Hunter
    Replies:
    0
    Views:
    520
    John Hunter
    Dec 15, 2003
  4. John Hunter

    ANN: matplotlib-0.50 - python plots

    John Hunter, Feb 17, 2004, in forum: Python
    Replies:
    5
    Views:
    613
  5. Andy Salnikov

    Timeline plots with Python

    Andy Salnikov, Apr 2, 2004, in forum: Python
    Replies:
    1
    Views:
    946
    Roy Smith
    Apr 2, 2004
Loading...

Share This Page