Skip to content

applying dropna resolves the bug but connects years that are not neig… #302

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

remicousin
Copy link
Contributor

…hbors

The best way to see the bug and its "solution" is to run the app and change the default onset search month from November to September. Then:

dropna is applied to onset date graph and the persisting graph is not happening anymore. However we don't want to connect years that are not neighbor.

dropna is not applied to cessation but cessation doesn't have na so it behaves.

dropna is not applied to length and we can see the persisting graph from before the callback.

I found this conversation about it that led me to try getting rid of na.

I will have another PR use another kind of graphics so that we circumvent the bug for now.

@remicousin remicousin added the bug label Mar 28, 2023
@remicousin remicousin requested a review from aaron-kaplan March 28, 2023 20:48
@aaron-kaplan aaron-kaplan marked this pull request as draft March 30, 2023 12:30
@aaron-kaplan
Copy link
Collaborator

As we've discussed before, a line graph really isn't appropriate here, because drawing a line graph from discrete points involves interpolation between the points, and it's nonsensical to say that the onset in year 1991.5 is halfway between the 1991 onset and the 1992 onset.

Plotly's current behavior in the presence of NaNs is clearly incorrect, but it's not clear to me that Ingrid's (or was it gnuplot's?) behavior (leaving blanks where there's no value) is the right way to handle it either. If interpolation is allowed between regularly spaced points on a continuum, why shouldn't it be allowed across irregularly spaced points too?

Switching to a bar or scatter plot is not just a workaround, it's also the right way to plot this variable. Given that, I'm not sure it's worth my time to figure out the plotly bug.

@remicousin
Copy link
Contributor Author

It's fine with me to move away from a line plot.

But it also means we can't make line plots unless we are certain there is no missing value in the series to plot.

@aaron-kaplan
Copy link
Collaborator

But it also means we can't make line plots unless we are certain there is no missing value in the series to plot.

That's true. Are there any graphs you think really should be line plots and have a possibility of containing missing values?

@remicousin
Copy link
Contributor Author

Probably not in Maprooms that are well curated products, and/or where the problem can be dealt with by picking another visual or by controlling filling missing values.
So it would become a more annoying problem in a Python-DL that would offer plotly viz'... so we aren't quite there yet.

@remicousin
Copy link
Contributor Author

The problem with scatter only is that it's harder to see the time evolution... That's why it makes sense to connect with lines even though the values between markers are meaningless... But I'll see if I find another visual that would do better.

Screenshot 2023-03-30 at 1 40 17 PM

@remicousin
Copy link
Contributor Author

A color gradient helps to see the time sequence better but one might wonder what the color is for while is just for x-axis and to help the reading....

Screenshot 2023-03-30 at 1 49 28 PM

@remicousin
Copy link
Contributor Author

Looks like a good old histogram is what works best....

Screenshot 2023-03-30 at 2 07 53 PM

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

Successfully merging this pull request may close these issues.

2 participants