-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get coloured graph. #133
Comments
Hi, What do you mean by "not colored", is it just one single color or you can't see anything at all? Best, |
Thanks for your response. This is the part of output file. Hope you understand the issue clearly now. I used this command The output I get |
Okay I see now! Which version of import seaborn as sns
print(sns.__version__) It might be that there's an edge around the markers in the plot which hides the actual color due to recent changes in the library |
I got this when I executed this command in jupyter 0.12.2 |
Try installing 0.11.0 instead: |
This frozen installation of conda install seaborn==0.11.0 didn't worked for me because it downgraded other libraries also. I used old one https://github.com/chemosim-lab/ProLIF-paper old version and its working. |
I see, I plan to include this seaborn code snippet directly in Prolif for the next update so I'll address this compatibility issue by then. |
Hello chemosim-lab
When I run this code i get graph but it is not colored whereas legends are indicated in colored. I am using Ubuntu 20.04.6 LTS and notebook in firefox. I usually get following warning.
home/XXXX/miniconda3/envs/prolif/lib/python3.11/site-packages/seaborn/axisgrid.py:118: UserWarning: Tight layout not applied. tight_layout cannot make axes width small enough to accommodate all axes decorations
self._figure.tight_layout(*args, **kwargs). Please suggest how to get colored graph. Thanks in advance.
import seaborn as sns
import pandas as pd
reorganize data
data = df.reset_index()
data = pd.melt(data, id_vars=["Frame"], var_name=["residue","interaction"])
data = data[data["value"] != False]
data.reset_index(inplace=True, drop=True)
plot
sns.set_theme(font_scale=.8, style="white", context="talk")
g = sns.catplot(
data=data, x="interaction", y="Frame", hue="interaction", col="residue",
hue_order=["Hydrophobic", "HBDonor", "HBAcceptor", "PiStacking", "CationPi", "Cationic"],
height=3, aspect=0.2, jitter=0, sharex=False, marker="_", s=8, linewidth=3.5,
)
g.set_titles("{col_name}")
g.set(xticks=[], ylim=(-.5, data.Frame.max()+1))
g.set_xticklabels([])
g.set_xlabels("")
g.fig.subplots_adjust(wspace=0)
g.add_legend()
g.despine(bottom=True)
for ax in g.axes.flat:
ax.invert_yaxis()
ax.set_title(ax.get_title(), pad=15, rotation=60, ha="center", va="baseline")
The text was updated successfully, but these errors were encountered: