using savefig

I need to save a figure for importing into another application. I wrote a module which creates a plot and then calls savefig to save the figure as a .jpg. This works fine when I run the applicaiton stand alone, but when I try to save a figure from another file (which happens to use wx), it can’t save as a .jpg (unknown file type). I believe this has to do with the backend being used (I think running stand alone it is using GTKapp). Is there a way to “force” this object to use a specific backend so I can use the .jpg file type?