Gert-Jan wrote:
> Hello again,
>
> Thanks for the reply! I did some more testing, but I couldn't get it to work
> yet. However, during the testing, I got the idea that I was wrong about what
> backends do; it appears they are only used for creating plots, not for
> saving them. For example:
>
>
>
>   
>> #!/usr/bin/env python
>>
>> import matplotlib
>> matplotlib.use('module://backend_emf')
>> from pylab import *
>>
>> x = [0,1,2,3]
>> y = [4,3,2,1]
>>
>> figure()
>> plot(x,y)
>> savefig('C:\\test.emf')
>>
>>     
>
> This still results in a NotImplemented error. Trying to save as another file
> type (savefig(C':\\test.pdf') for example) won't work anymore, either.
> Trying to save as PDF, for example, gives this error message:
>
>
>
>   
>> ValueError: Format "pdf" is not supported.
>> Supported formats: emf.
>>
>>     
>
> Basically, what I'd like to have is that, when the user views the plot and
> presses the save button, the user can select 'Enhanced Metafile (*.emf)'
> from the file type list and save as EMF.
>   
Can you be more specific about why that doesn't work?
> Well, thanks for the help so far. I hope there is a solution for this.
> Otherwise I think I'll revert to an older version.
>
> PS. It appears as though the Matplotlib creators have forgotten to remove
> EMF from the file type list, as it's still there.
>   
Yes -- that was an oversight.
> Also, there appears to be a bug when saving files, as the selection from the
> file type list is ignored and the file is saved as PNG instead, unless you
> manually add another extension in the name.
>   
What GUI backend are you using?  That sounds like a bug in how the file 
selection dialog is being used.

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to