User warning: steamed pgf-code does not support raster graphics

I am using the the latest version: 3.2.0, and am using the PGF backend, as described here:

When I save the figure, I get a warning that says:

User warning: steamed pgf-code does not support raster graphics, consider using the pgf-to-pdf option.

I have no idea what that means, and I can’t find anything like that in the documentation. Can someone tell me what I might be doing wrong?

Hi @physkets, can you please post a minimal version of your code here? It might be a default argument to a plotting method problem.

You may use some file named file.dat with two columns of data.

import matplotlib as mpl
    "": "serif",
    "font.serif": [],
    "font.sans-serif": [],

import matplotlib.pyplot as plt
import numpy as np

AXES = plt.gca()


i = 0
for data_file in FNAMES:

        X, Y = np.loadtxt(data_file, unpack=True)
    except OSError:
        print("No file at ", data_file)
        i += 1
        AXES.plot(X, Y, f'C1.')

AXES.set_ylabel(r'$y$', fontsize='xx-large')
AXES.set_xlabel(r'$x$', fontsize='xx-large')

plt.savefig('figure.pgf', bbox_inches='tight')

This was accidentally introduced by, but is later fixed by, which was not in 3.2; I’ll backport it for 3.2.1.

1 Like