Martin Becuwe
Martin Becuwe

Reputation: 117

How to visualize personalized plot in Orange3 pipe?

I would like to display JS or matplotlib output of a Python script included in Orange3 pipe directly in Orange but I can't seem to find any satisfactory solution, is it something possible in Orange please? Thank you in advance, Martin

Upvotes: 0

Views: 226

Answers (1)

Primoz
Primoz

Reputation: 1492

There are two options (I hope that any of them helps).

If you have data that you can send them from the Python script widget to the Scatter plot widget (data in the orange Table) use this method. In the Python Script widget save data on out_data variable and connect the Scatter Plot widget on it. There is a save icon at the bottom of the Scatter Plot widget which can save your plot. One of the options is to save data to the .py script which produces a plot with matplotlib. This script can be modified such that desired results are reached.

The other option is to pickle data (save them in a file) in Python Script widget. You can pickle data with adding this snippet at the end of the code in Python Script widget

import pickle
with open("<full path>", "wb")  as f:
    pickle.dump(<your_data>, f)

<full path> is the path on your computer where you want to save your data.

Pickle will save all the data you provide in the dump function. You can open those data in the python script on the computer and do plotting with matplotlib. Here are the instruction to un-pickle (load) your data.

Upvotes: 0

Related Questions