-
Notifications
You must be signed in to change notification settings - Fork 401
Filling area between two time- or space-series #7900
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
Conversation
Fill area between two curves, but consider crossings, unequal start and end, and the precense of NaNs.
|
Addendum: I do think these are needed:
|
|
Adresses #7869 |
|
I find the rectangles in labels an over complication. All that is needed is line labels. Then what is above or bellow is obvious from the figure. |
This is needed if one wants to place anything related to S1 in the legend.
|
What I mean is that with no more lines in the script we can lave a legend that says "lambda 1; lambda 2". It looks to me, and your mention to plotting the lines separately, that it cannot currently be done. Again, fine that some one wants to fill the legend space with useless information, but it shouldn't be the default. |
|
Sure. Happy to hear what others think of defaults and legends. Better speak up now and have a chance to affect the final implementation or complain later on that it would have been better if... |
|
What do you want it to be? You have full control over that. I should have guessed that comparing to zero or some other horizontal level is useful so I added +y[level] where the S1 comparison "dataset" is a constant, such as in the bottom plot below. Not sure why the amplitudes are different - probably something I did wrong. |
|
Oops, forgot to hit the button yesterday. For me this info in legend is all it needs to understand the plot. And, as a side note, I find it a little buggy that GMT needs to be helped with |
|
Hm, I'll look at that gmtinfo issue. yyyy-mm-dd is the ISO standard I think but yours have the same order so ought to handle it I think. You can get the legend you want by plotting with -M and color fills but no legend entries, then replot with pens and no fill and set the two legend entries. |
|
Anything else missing from the implementation now that I added +y? @joa-quim ? @anbj ? @Esteban82 ? |
In that case we have two options :
|
|
Don't have a use case for this right now, so not much to contribute with in this discussion. |
Don't understand this comment. My plot clearly shows two lines with two colors. It was made with my GMT.jl function where I passed the legend as
A bit convoluted. And not to say that the legend with the squares needs to be longer. It has to say |
|
Doable now I think? Use -l for one legend entry and -M+l for the other label. Or plot them as continuous lines with plot and add legends there. The rules currently in place say:
The same rules apply to -M (+gfill and +ppen) provided -M+llabel is set. To me, your case would use the -M option with fill and no pens (or set the two pens equal for outline), then plot the two curves separately with your fill color as pen color and add -l for each line. Question: Is the switching of pen color where S0 and S1 cross useful or useless? |
|
Have to go (classes). |
|
We programmed GMT to handle any stupid date stamp format, even 2-digit years, month names, US order versus sane order. I understand it may be frustrating that yyyy/mm/dd is not parsed well when the default ISO format is yyyy-mm-dd but the fault there lies with data producers who dont follow conventions. Are we also going to build in special checks that detects that the month field exceeds 12 but never 31 and hence guess that it is mm/dd/yy? This would never end. |
Weren't we talking about issuing warnings everywhere a few threads ago? 😛 |
|
BTW, it vaguely reminds me of https://forum.generic-mapping-tools.org/t/color-gradient-fill-for-figures/1420/3?u=planetgus |
Maybe, but that would also never end. I cannot be our job to code up all these things just because people are no longer able to read instructions or store data in dumb formats. |
|
I have to go too.
Option A (default): Option B: Option C: Have a good weekend ! |
|
I don't like indicating the fill of an area (between the two curves) but new modifier +r will (as the Julia examples) draw a line in the legend instead of the default filled rectangle. It replaces the pen color with the fill color though so this should be more than enough flexibility for version 1. I will make a doc/script illustration for inclusion in the plot RST documentation but I think this branch is good to go so I hvae removed the WIP. |
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)Report last updated at commit d5ae625 |
* Start 6.5 changelog * Update changes.rst * Add windbarbs reference * Ref #7900 * Finish changelog for 6.5 --------- Co-authored-by: Paul Wessel <pwessel@hawaii.edu> Co-authored-by: Joaquim <jluis@ualg.pt>





See discussion in this Forum post for background. This branch implements this feature via a new option to plot: -M[c|s][+gfill][+ppen]. This is a draft implementation so neither this syntax nor behavior is finalised. If you build from this branch you can run this short script:
which plots this:
Some features (as implemented): Here, S0 is the first series and S1 the second series (time or space):
S0 > S1can be specified via -Gfill.S1 > S0can be specified via -M+gfill.Open-ended questions: