Skip to content
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

Error when using with Plotly Subplots #21

Open
matthewtoholland opened this issue Nov 3, 2022 · 3 comments
Open

Error when using with Plotly Subplots #21

matthewtoholland opened this issue Nov 3, 2022 · 3 comments

Comments

@matthewtoholland
Copy link

When trying to use molplotly to generate hover structures with a series of scatterplots generated using make_subplots (generated using different columns of a dataframe for the same RDKit molecule row), molplotly.add_molecules returns

ValueError: More than one plotly curve in figure - color_col and/or marker_col needs to be specified.

As these plots are generated using different columns, rather than faceting data in a single column based on values in another, there is no common color or marker column. Is there a way to generate molecular structures for these subplots?

@wjm41
Copy link
Owner

wjm41 commented Nov 10, 2022

Hey, thanks for the question! Could you provide a toy example in code of what you'd like to plot? I'll try to have a look over the weekend :)

@matthewtoholland
Copy link
Author

Sure, please find attached the test data. What I am looking for is a scatter plot faceted by the 'variable' column (so should be three plots), where the structures are revealed on hovering. I have included a code snippet below!

data = pd.read_csv('test_data.csv')
plot = px.scatter(data, x='value', y='Assay', facet_col='variable', hover_name='variable')
plot.update_xaxes(range=[1.0, 0.6])
plot.update_yaxes(range=[2.5, 0])

test_data.csv

Thank you!

@wjm41
Copy link
Owner

wjm41 commented Nov 24, 2022

Hey, sorry for the delay - I've updated the package and it should be able to handle data faceting now. Could you install the latest version with pip install molplotly==1.1.5 and see if that works for you? :D

I haven't tested make_subplots yet but if it's just using facet_col in scatter it should work. I've included your example data at the end of examples/simple_usage_and_formatting.ipynb to showcase it working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants