Skip to content
Snippets Groups Projects
Verified Commit 660b46b9 authored by nfontrod's avatar nfontrod
Browse files

src/figures_utils/build_rfreq_radarplot.py: small change to make this work...

src/figures_utils/build_rfreq_radarplot.py: small change to make this work with the script src/figures_utils/build_refreq_radarplot4_com.py
parent 2c4a43f9
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,8 @@ from typing import List
import lazyparser as lp
import pandas as pd
import plotly
import plotly.graph_objects as go
import plotly.io as pio
import seaborn as sns
from matplotlib.colors import to_hex
......@@ -25,6 +25,8 @@ from .relative_frequencies_between_communities import (
reordering,
)
pio.kaleido.scope.mathjax = None
def build_rfreq_dataframe(
df_freq: pd.DataFrame,
......@@ -102,7 +104,7 @@ def radar_chart(
radialaxis=dict(visible=True, range=[minv, maxv]),
),
)
plotly.offline.plot(fig, filename=str(outfile), auto_open=False)
fig.write_image(outfile, width=800, height=600)
@lp.parse(
......@@ -122,7 +124,7 @@ def build_rfreq_figure(
filter_cpnt: List[str] = (),
palette: List[str] = (),
reverse: bool = False,
) -> None:
) -> Path:
"""
Build a barplot displaying the relative frequencies between two \
communities
......@@ -150,9 +152,10 @@ def build_rfreq_figure(
nf = Path(com_file).stem
outfile = (
Config.radar_plot
/ f"radar_{cpnt_type}_{region}_{nf}_{ncom1}_{ncom2}.html"
/ f"radar_{cpnt_type}_{region}_{nf}_{ncom1}_{ncom2}.pdf"
)
radar_chart(df_rfreq, outfile, palette)
return outfile
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment