-
Notifications
You must be signed in to change notification settings - Fork 3
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
plotting object with season dimension = 12 #13
Comments
The conversion takes place in FLCore::as.data.frame(FLQuant), with date=TRUE. The date column is of class ISOdate, and season is passed as numeric. I have added a small check for seasons being months to use the first day as season start. See here https://github.com/flr/FLCore/blob/master/R/FLQuant.R#L1037 Does this help? |
Works perfect. I assume that since I didn't need to add any additional arguments to |
The call to as.data.frame inside ggplotFL::plot sets date=TRUE, yes, although only uses it in the x axis if length(season) > 1. |
Hi there - it looks to me as if this functionality has been lost. The season dimension is no longer correctly handled. |
Have you reinstalled from github over the last few days? I have changed a bit the engine, now using our own geom_ function. Will check this is working as it should with the new code |
Yes, I don't know exactly when it happened, but installing one of the other packages (FLBRP?) automatically reinstalled several other dependencies as well. I tried reinstalling ggplotFL today and still get the plotting problem - Could the date conversion be the issue again (i.e. ISOdate)? |
It would seem to me that now: |
OK, will fix now, and will release new ggplotFL. |
Could you possibly install the package in github and see if it has been fixed? |
Looks good now - thanks so much. One caveat: the plotting function removes empty ages / years. I think I am fine with this, but just wanted to make sure that you want this as the default. |
Are you plotting a single FLQuant? It probably shouldn't, specially since the function offers you to plot dots at data=0 for NAs. Let me check |
Yes, a single FLQuant. The behavior you describe used to be the case, but no longer is. NAs, are converted to zeros, and dims containing all NAs are dropped completely. I can send you an example. |
here is an example of the behavior:
|
Thank you for this. Sorry, I didn't know it would be this complicated. Yes,
line breaks (i.e. NaN during an otherwise non-NA time series) also appear
to be ignored (or removed before plotting).
…On Mon, Mar 4, 2019 at 3:32 PM Iago Mosqueira ***@***.***> wrote:
The old code worked as expected if the break included the start or end of
the time series, so the line was shown shorter. Breaking the line is a
different thing. Can be done, but requires a bit more work. Working now on
getting empty panels back, and having the NA dots plotted.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHxTEymKndPJICZLcFpdQSTg9-bhiuyAks5vTS6BgaJpZM4WmxPY>
.
|
Not at all, thanks for noticing. This works for me now
Can you confirm if it does for you? It is still not working this way in the case when iters are involved, the lines get joined. So this issue can remain open for the time being |
One way to achieve it might be to make geom_flquantiles to create separate geom_ribbon calls, r rathr grid_polygon ones, for each segment interrupted by NAs in the year+season dimension. |
Yes, thank you. The plot is working as before now. Until now, I have not been plotting objects with multiple iters. In that case, I would probably manually replace NAs with zeros if needed. Maybe there can be a separate argument in the plotting function for NA replacement? Cheers |
I think changes to data are best made outside of the plot call. I will try to find a way to make the geom cut those time steps all missing. |
Hi there,
I think there may need to be an adjustment to the way the season dimension is handled in ggplotFL. In my example, I have 12 months in the season dimension. I believe season gets originally treated as a factor, and then converted to numeric. This seems to mess up the month order in my case (e.g. "1", "10", "11", "12", "2", "3", "4", "5", "6", "7", "8", "9").
Below is a fix that re-orders the levels based on their sequence in the dimnames of the FLStock object.
direct plot with ggplotFL:
adjusted version with ggplot2:
The text was updated successfully, but these errors were encountered: