Stacking line graphs

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9626
    sandra
    Participant

      I have a column with dates spanning 2018-2020. I would like to make a plot where my x-axis is June-October (sampling dates), and where my y variable (in this case NH4) are stacked by years like below. Any help with this one?Screenshot 2022-09-01 at 11.12.08

      #9627
      dgteam
      Moderator

        I made up some similar data in one column where there is some type of seasonal trend.  If it is graphed using the Plot command as is, you get this …

        Monthday01

        It sounds like what you would rather show is something like this…

        Monthday02

        To do this we created two new columns using Expression columns with the Date/Time Functions.

        The “year(Date)” function let’s us extract a column to use as a mask, Year.

        The MonthDay column uses the “seconds(year, month,day)” function to construct a date that has all the same dates as before, but now has all the same year.  Doesn’t really matter what year you use here just that you use something fairly reasonable. Here was set it to 2000.

        MonthDay

        Once you have that, now you can create a Plot command for each line, using the MonthDay column as the x value. Add a mask for each year and make sure the Legend name matches.

        MonthDay2

        To make it more convenient to adjust the line width, you can also add a slider variable and enter the name in the line width.  Here we called the variable “width”.

        MonthDay3

        We’ll upload this file to the File > On-line examples.

        Does this approach work for your data?

         

        #9628
        sandra
        Participant

          That worked beautifully! Thanks for your help.

          Sandra

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.