Matplotlib charts in SPSS

Can I use any other graphics library in SPSS that is built-in? I just opened python extensions that make SPSS great.

import matplotlib.pyplot as plt
from numpy.random import rand


fig, ax = plt.subplots()
for color in ['red', 'green', 'blue']:
    n = 750
    x, y = rand(2, n)
    scale = 200.0 * rand(n)
    ax.scatter(x, y, c=color, s=scale, label=color,
               alpha=0.3, edgecolors='none')

ax.legend()
ax.grid(True)

plt.show() 

This will create a simple scatter plot and it works fine in any IDE, but when I try to use this code in SPSS, BEGIN PROGRAM END PROGRAMI get the following error:

RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X.
 Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ

Maybe I'm asking too much about the python extension in SPSS, but it would be nice to use a different graph library than the one that was built in.

+4
source share
2 answers

Adding more information as another answer as the comment field is too limited.

- Windows, , . - . , , ( ).

enter image description here

, , , ( ).

, matplotlib, -, Apis SpiceClient . . CreateImageChartItem (Python) Python. , matplotlib , .

R- ( Python - (!)), . Python GPL, , , .

, , Python, , Python , Python, IDE Python, ,

import spss

Python, SpssClient. IDE (Wing Professional), . , , spss apis .

+1

Python, . ​​ Python (Python Essentials), Python, Python, . , , , -, .

- Python ( 2.7 3.4 24, Python 3). "" > "" > "" . . Anaconda, .

Mac, - .

+1

Source: https://habr.com/ru/post/1667435/


All Articles