Python - matlab interface help!! Urgent

Albert Hofkamp hat at se-126.se.wtb.tue.nl
Mon Apr 19 03:37:44 EDT 2004


On 16 Apr 2004 07:42:04 -0700, Leeny <leens_chacko at hotmail.com> wrote:
> leens_chacko at hotmail.com (Leeny) wrote in message news:<ca305c70.0403311357.3d436b2b at posting.google.com>...
>> Hi Group,
>> 
>> Hope someone can help me with this problem. I am a new user to python
>> and am currently working with pymat module of python (for coursework).
>> 
> 
>> I tried to create plots thru pymat using pymat.eval(h, 'plot(x,y)')
>> This is working fine. However, i dont know how to print or save this
>> plot as a .tif image something like
>> 
>> print(gcf, '-dtiff', 'test')
>> 
>> using pymat.
> One suggestion I got was to use mathplotlib, but since i have done
> some work uisng pymat, I would like to know if there is some way it
> can be done using Pymat.

The last parameter of eval is the literal matlab command as a string (ie
quotes before and after it).

In other words if you type XYZ to do it in matlab, then the pymat
equivalent is pymat.eval(h,'XYZ')

If you have ' inside XYZ, use " instead, like pymat.eval(h,"XYZ") .



So, if the print command is how to print something, do

pymat.eval(h,"print(gcf, '-dtiff', 'test')")


Albert
-- 
Unlike popular belief, the .doc format is not an open publically available format.



More information about the Python-list mailing list