Python Forum
Create PDF with text from PNGs - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Create PDF with text from PNGs (/thread-3366.html)



Create PDF with text from PNGs - hugfer96 - May-18-2017

Hello. I need to make a PDF from four graphic plots, that are supposed to be displayed in  landscape orientation and in a 2x2 matrix (preferably, with controlable sizes) . These plots follow a title and are followed by some descriptive text. Please refer to me those commands and modules you find useful for this task.

What I have so far :

        fig = plt.figure()

        ax0 = fig.add_subplot( 223 )
        ax0.set_title( 'Phase folding for trial search #' + str(period_trial+1) + '.' )
        ax0.plot(phase, lc, '.')
        ax0.set_xlabel('Phase')
        
        ax1 = fig.add_subplot( 224 )
        ax1.set_title( 'Zoom for trial search #' + str(period_trial+1) + '.' )
        ax1.plot(phasezoom,lczoom,'.')
        ax1.set_xlabel('Phase')
                                             
        ax2 = fig.add_subplot( 222 )          # periodgram
        ax2.add_line(  lines.Line2D( [best_period,best_period], [min(power),max(power)],linestyle='dashed',color='red') )
        ax2.set_title('Periodgram')
        ax2.semilogx(per, power, 'k-', lw=2)
        ax2.set_xlabel('Period [days]')
        ax2.set_ylabel('BLS power')  
Best regards!


RE: Create PDF with text from PNGs - Larz60+ - May-18-2017

There are quite a few PDF packages available here: https://pypi.python.org/pypi?%3Aaction=search&term=pdf&submit=search
I'm not up to date on which is best.
A good bet is to check the date the package was created, the last update, and how many downloads have occurred.