0

I know that I can plot my python-generated data by matplotlib. The reason why I want to plot my data using Scilab is keeping plotted figure the same style. Because I already have plotted many figures using Scilab.

Should I use subprocess.Popen to run a scilab script? Is there a better way than this.

0

2 Answers 2

1

The sciscipy python package seems to provide interface to Scilab features inside Python.

An example for you to assess if this is what you want:

from scilab import Scilab
sci = Scilab()
x = sci.rand(20, 20)
y = x*x.transpose()
y_inv = sci.inv(y)
Sign up to request clarification or add additional context in comments.

Comments

0

You can make your python script interact with your scilab plotting script through sockets. Here's how you send data from python:

import socket                                              
import sys                                                 

host = socket.gethostname()                                
port = 59981                                               
try:                                                       
    soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    soc.bind((host, port))                                 
except socket.error:                                       
    print "Unable to setup"                                

soc.listen(5)                                              
while True:                                                
    conn, addr = soc.accept()                              
    conn.send("data")                                      
    conn.close()    

1 Comment

Thanks. :-) Interesting. I will try when I have time. deadline approaching, not enough time to try socket....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.