Skip to content
Snippets Groups Projects
Commit 62c08952 authored by Mouhcine's avatar Mouhcine
Browse files

Modificatin de l'import des figures

parent d9f3b203
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ from scipy.sparse import csgraph
# Modelling
# import julia
from julia import Main, Jchemo, DataFrames, Base, Pandas
#from julia import Main, Jchemo, DataFrames, Base, Pandas
from pinard import utils
from pinard import preprocessing as pp
......
......@@ -224,34 +224,33 @@ if not t.empty:
name = 'selected samples')
st.plotly_chart(fig, use_container_width=True)
import plotly.express as px
## Export en 2d Axe1..Axe3
if not t.empty:
if dim_red_method == dim_red_methods[1]:
# nombre de clusters
num_clusters = len(np.unique(labels))
# Une couleur par cluster
custom_color_palette = px.colors.qualitative.Plotly[:num_clusters]
color_discrete_sequence=custom_color_palette
# Créer et exporter le graphique Axe1-Axe2 en PNG
fig_axe1_axe2 = px.scatter(tcr, x=axis1, y=axis2, color=labels if list(labels) else None, color_discrete_sequence=custom_color_palette)
fig_axe1_axe2.update_layout(title='Axe1-Axe2')
fig_axe1_axe2.update_traces(marker=dict(size=4))
fig_axe1_axe2.write_image("plot_axe1_axe2.png")
# Créer et exporter le graphique Axe1-Axe3 en PNG
fig_axe1_axe3 = px.scatter(tcr, x=axis1, y=axis3, color=labels if list(labels) else None, color_discrete_sequence=custom_color_palette)
fig_axe1_axe3.update_layout(title='Axe1-Axe3')
fig_axe1_axe3.update_traces(marker=dict(size=4))
fig_axe1_axe3.write_image("plot_axe1_axe3.png")
# Créer et exporter le graphique Axe2-Axe3 en PNG
fig_axe2_axe3 = px.scatter(tcr, x=axis2, y=axis3, color=labels if list(labels) else None, color_discrete_sequence=custom_color_palette)
fig_axe2_axe3.update_layout(title='Axe2-Axe3')
fig_axe2_axe3.update_traces(marker=dict(size=4))
fig_axe2_axe3.write_image("plot_axe2_axe3.png")
# Graphique pour les dimensions (axis1, axis2)
fig_2d_axis1_axis2 = px.scatter(t, x=axis1, y=axis2, color=labels, color_discrete_sequence=custom_color_palette)
img_2d_axis1_axis2 = pio.to_image(fig_2d_axis1_axis2, format="png")
with open("./Report/figures/scores_plot_2d_axis1_axis2.png", "wb") as f:
f.write(img_2d_axis1_axis2)
# Graphique pour les dimensions (axis1, axis3)
fig_2d_axis1_axis3 = px.scatter(t, x=axis1, y=axis3, color=labels, color_discrete_sequence=custom_color_palette)
img_2d_axis1_axis3 = pio.to_image(fig_2d_axis1_axis3, format="png")
with open("./Report/figures/scores_plot_2d_axis1_axis3.png", "wb") as f:
f.write(img_2d_axis1_axis3)
# Graphique pour les dimensions (axis2, axis3)
fig_2d_axis2_axis3 = px.scatter(t, x=axis2, y=axis3, color=labels, color_discrete_sequence=custom_color_palette)
img_2d_axis2_axis3 = pio.to_image(fig_2d_axis2_axis3, format="png")
with open("./Report/figures/scores_plot_2d_axis2_axis3.png", "wb") as f:
f.write(img_2d_axis2_axis3)
if not spectra.empty:
if dim_red_method == dim_red_methods[1]:
......
src/plot_axe1_axe2.png

35.6 KiB

src/plot_axe1_axe3.png

35.8 KiB

src/plot_axe2_axe3.png

34.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment