File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,8 +208,6 @@ def test_pdf_pages():
208208 }
209209 mpl .rcParams .update (rc_pdflatex )
210210
211- Y , X = np .ogrid [- 1 :1 :40j , - 1 :1 :40j ]
212-
213211 fig1 = plt .figure ()
214212 ax1 = fig1 .add_subplot (1 , 1 , 1 )
215213 ax1 .plot (range (5 ))
@@ -223,3 +221,24 @@ def test_pdf_pages():
223221 with PdfPages (os .path .join (result_dir , 'pdfpages.pdf' )) as pdf :
224222 pdf .savefig (fig1 )
225223 pdf .savefig (fig2 )
224+
225+
226+ @needs_xelatex
227+ @pytest .mark .style ('default' )
228+ @pytest .mark .backend ('pgf' )
229+ def test_pdf_pages_metadata ():
230+ rc_pdflatex = {
231+ 'font.family' : 'serif' ,
232+ 'pgf.rcfonts' : False ,
233+ }
234+ mpl .rcParams .update (rc_pdflatex )
235+
236+ fig = plt .figure ()
237+ ax = fig .add_subplot (1 , 1 , 1 )
238+ ax .plot (range (5 ))
239+ fig .tight_layout ()
240+
241+ md = {'author' : 'me' , 'title' : 'Multipage PDF with pgf' }
242+ with PdfPages (os .path .join (result_dir , 'pdfpages.pdf' ), metadata = md ) as pdf :
243+ pdf .savefig (fig )
244+ pdf .savefig (fig )
You can’t perform that action at this time.
0 commit comments