WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Bringing Matplotlib 3d Plot to vizard for VR expereince. (https://forum.worldviz.com/showthread.php?t=6389)

CJaiswal 03-11-2022 11:51 AM

Bringing Matplotlib 3d Plot to vizard for VR expereince.
 
Hi Team,
I am working on a project where I need to bring the matplotlib 3d plot output to vizards to have the VR experience. Any idea how can we achieve it? Below is the code which I want to bring into VR Vizards. Below only creates the plot in 3d visual only as per the matplotlib, No Vizards Vr Environment. Any help would be appreciated.

from sklearn.datasets import load_wine
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
import matplotlib
#matplotlib.use('agg')

import matplotlib.pyplot as plt
winedata = load_wine()
X, y = winedata['data'], winedata['target']
pca = PCA()
pipe = Pipeline([('scaler', StandardScaler()), ('pca', pca)])
Xt = pipe.fit_transform(X)
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
plot = ax.scatter(Xt[:,0], Xt[:,1], c=y)
plt.legend(handles=plot.legend_elements()[0], labels=list(winedata['target_names']))
plt.show()


All times are GMT -7. The time now is 08:43 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC