-
Notifications
You must be signed in to change notification settings - Fork 2
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
plot_emission_intensity
outputs metrics with incorrect order of colours when used with scale_colour_r2dii
#527
Comments
The function r2dii.plot/R/plot_emission_intensity.R Line 101 in ed4775e
|
Function was introduced in #339 however this was a pure refactor, and the logic existed before |
#158 (from 3 years ago, seemingly one of the first commits to this function) is where this behavior was introduced. |
@MonikaFu I would like to revert some of the logic that was introduced in that PR. In my opinion, it is more preferred that the user should be able to reliably input specific (it seems you from 3 years ago agreed with me hahaha): Note: Mauro demos that it is possible to change the colours still with the |
I agree with you on this
That is why I called this behaviour a bug. However, I do think that the legend order matching the order of the lines helps the plot readibility a lot, especially when more lines are present. I'd like to research if it is possible to change order of the legend only without changing the order of the data. We can do it in another issue. |
Sounds great! |
Expected behaviour:
Using
plot_emission_intensity
with inputdata
that has specifically ordered factors foremission_factor_metric
in conjunction withscale_colour_r2dii
with custom colourlabels
, outputs a plot whosemission_factor_metric
has those colours (same order).Observed behaviour:
Output has the correct values for colour, however the order gets scrambled.
See reprex below:
Created on 2024-01-17 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: