Skip to content

Ternary KDE estimation + show ternary plot markers on edges #2574

@olgabot

Description

@olgabot

Hello,
Thanks for making this package, especially plotly_express which greatly simplify visualization tasks.

This issue is potentially related to #1700. I'd like to overlay a density plot and scatterplot in a ternary plot, like below:

image

(plot above from here

I'm plotting medians of gene expression across three species: mouse, lemur, and human. Here is the data I'd like to visualize, as a seaborn pairgrid:

image

The reason for this is because when I use px.scatter_ternary, then the markers in the corners basically don't show up, but I know there are many points there, and I'd like to see that there are many there in the corner.

Screen Shot 2020-06-17 at 9 38 02 AM

import plotly.express as px

fig = px.scatter_ternary(df_nonzero_for_plotly, color='de_species_logfoldchanges',
                         color_discrete_map=palette.to_dict(),
                         a="lemur", b="mouse", c="human", 
                         hover_name="gene_name", opacity=0.5)
fig.show()

So here are my questions:

  1. Is it possible to turn off clipping/masking of the markers so the edges become more obvious?
  2. Is it possible to create a kernel density estimation (KDE) of the ternary density to overlay with a scatterplot?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions