0

Here is an example of vertical gradient color filled under a curve.

I would like a variation: the color filled under the curve represents a 'feature' of the variable. For example: enter image description here

In the second subplot, the grey line is the feature importance of GPP (a variable), and the yellow line is the value of GPP. So, can I just plot one line representing the evolution of GPP, and fill the gap between this line and x-axis with a horizon gradient color? 'horizon gradient' means that, the deeper the filled color is, the larger the feature importance is. And the colorbar (of the filled color) involves the timing-evolution of feature importance.

By the way, I have 4 input variables and 3 output observation labels on multiple groups (4 different vegetation types, that means 4X and 3Y for each individual vegetation type). How can I plot their time evolution efficiently? (without needing to plot a HUGE amount of subplots.)

JohanC
  • 71,591
  • 8
  • 33
  • 66
Xu Shan
  • 175
  • 3
  • 11
  • Check e.g. https://stackoverflow.com/questions/44959955/matplotlib-color-under-curve-based-on-spectral-color/44960748#44960748 – ImportanceOfBeingErnest Feb 05 '20 at 18:20
  • You can use matplotlib's `fill_between()`: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.fill_between.html – Daniel Lima Feb 05 '20 at 18:21
  • Maybe [this approach](https://stackoverflow.com/questions/29321835/is-it-possible-to-get-color-gradients-under-curve-in-matplotlib) can be adapted to your use case? – JohanC Feb 05 '20 at 19:56
  • wow, thanks you guys! I will check those approaches. (sorry I don't know how to reply you individually...) – Xu Shan Feb 08 '20 at 11:53
  • @JohanC Thanks but unfortunately it's vertically gradient...And I prefer horizontally gradient color filled... – Xu Shan Feb 08 '20 at 11:57
  • Well, that's why it needs adaption for your case: swap the x and the y direction. But it will take some work to get everything perfect. – JohanC Feb 08 '20 at 12:38

0 Answers0