-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
harmonize ECDF between "h" and "v", removed "reversed" mode #3407
base: master
Are you sure you want to change the base?
Conversation
@@ -426,20 +426,21 @@ | |||
"If provided, and if `trendline` is set, all trendlines will be drawn in this color rather than in the same color as the traces from which they draw their inputs.", | |||
], | |||
trendline_scope=[ | |||
"str (one of `'trace'` or `'overall'`, default `'trace'`)", | |||
"str (default `'trace'`)", | |||
"One of `'trace'` or `'overall'`", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot one "." here...
Thanks for this PR! I'll be able to take a look at it next week, before the next release :) Have a nice weekend! |
One quick note is that I will not be able to merge this as-is given that it removes functionality. We still need to accept |
Hi,
I see, yes, that seems a good way of dealing with it. Do you have some language to that effect? I would suggest:
One of `'standard'`, `'complementary'`, or `'reversed'`.
…
`'reversed'` is deprecated as it was equivalent to `'complementary'`.
Cheers
Philip
PS: I will need to fix the code because “black” currently complains (forgot to check that ahead of time!)
… On Oct 1, 2021, at 5:16 PM, Nicolas Kruchten ***@***.***> wrote:
One quick note is that I will not be able to merge this as-is given that it removes functionality. We still need to accept reversed as an argument for backwards-compatibility. If you want to propose to make this equivalent to complementary we'd need to implement and document that in the docstring :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#3407 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABRZ5BCFYJO75KREXXOXYH3UEYQKTANCNFSM5FFQEYZA>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
----
Dr. Philip Eisenlohr
Associate Professor
Computational Materials Mechanics
Department of Chemical Engineering and Materials Science
Adjunct Associate Professor
Department of Physics and Astronomy
Michigan State University
+1 517 432-4506
***@***.***
https://www.researchgate.net/profile/Philip_Eisenlohr
|
@nicolaskruchten, who would be able to perform the code review? |
Hello @eisenlohr! I'm sorry for the long delays in responding here, I've gotten very far behind in my work! I will try to review this before the end of the year. I do have some hesitations about the idea of merging reverse and complementary, as they don't really mean the same thing... from the docstring:
The complementary ECDF is 1-ECDF, so the definitions of standard and complementary are correct here. I added reverse mode because, indeed, there was a missing point. As to the idea of adding an extra point to the series, I am also ambivalent, as this point is not in the underlying data, and will cause duplicated hoverlabels: the 'extra' point will have the same |
Hi @nicolaskruchten, Thanks for giving this some thought.
In summary, I believe that most of the confusion arose due to "1." not being correct, i.e. the current implementation does not yield properly transposed images. Once this is fixed, then it becomes apparent that there is no difference anymore between plots that would result from 'complementary' compared to 'reversed'. |
Hi @nicolaskruchten , Did you get a chance to contemplate my above remarks? Many greetings, |
Hi Philip, I sincerely apologize for letting this languish for so long... I've been a bit distracted by various life events recently (I've just started graduate school!) so I'm behind in Plotly.py work like reviewing PRs. I will definitely try to merge some or all of this PR in an upcoming release :) Cheers, |
Hi @nicolaskruchten, to lend some further support to the argument I made regarding item 3 above, the ECDF is plotted in the same way, i.e. spanning fully between 0 and 1, in Seaborn (see second-to-last example at https://seaborn.pydata.org/generated/seaborn.displot.html#seaborn.displot). |
Hi @nicolaskruchten, I am trying another ping at this. The Seaborn image I was referring to in my previous post is this: |
@nicolaskruchten, there is another argument that I would like to stress: the cumulative probability for a single-valued population should be a step function at that value. This is indeed reflected in the output of Seaborn, but not (yet) in plotly.express: import pandas as pd
import seaborn as sns
import plotly.express as px
df = pd.DataFrame(dict(x=[1]))
sns.displot(data=df,
x='x',
kind='ecdf',
).savefig('ECDF_seaborn.png')
px.ecdf(df,
x='x',
).write_image('ECDF_plotlyexpress.png') Seaborn outputPloty.express output |
Thank you for your persistence with this issue! I'm still quite embarassed at how long it has been open and how hard it has been for me to find time to properly consider it and I continue to apologize. Your arguments make sense, so my silence is not intended as passive disagreement! |
@nicolaskruchten, no offense taken. I am aware that there is always more to do than hours in a day! |
Changes
px.ecdf
functionalityI changed three aspects of the ECDF functionality:
'complementary
').x=values,y=weights,orientation='v'
is the EXACT transpose ofy=values,x=weights,orientation='h'
.This symmetry was lacking in the former implementation as can be seen in the examples mentioned below.
'reversed'
option has been removed as it was essentially a copy of'complementary'
with the opposite end omitted.Example plots of original functionality:
Example plots of updated functionality now exhibiting proper symmetry:
Above images were produced with
px
doc-stringsCode PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).