Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combine one single graph with three small graphs, with same y-axis scale and some conditions to be fullfilled

    Hi everyone,

    I am stuck and need some help please:
    I want this graph, but cut into three chunks:
    Click image for larger version

Name:	time_series.png
Views:	1
Size:	55.4 KB
ID:	1732821






    I want each subgraph with a different time span:
    • For first the time should extend from 01 July 2021 up to 31 July 2021, with the three curves (Strategic Prices, Competitive Prices and Real Prices).
    • For second subgraph: the time extends from 1 January to 31 December 2022, with the three curves.
    • For the third one: the time goes from 01 January 2023 to 31 July 2023, with the three curves.
    For first subgraph: ideally I should have a xline breaking data from 01 July 2021 onwards (before 01 July, data are missing),
    For third subgraph: ideally I should have a xline breaking data on 31 July 2023. Data are missing from 01 August onwards.

    How can I have these different time spans into account on my graph, please?

    Also, I need the following please:
    • Every subgraph should be on the same scale on the y-axis. On the x-axis, the scale should be also the same (in the sense that for each subgraph, I should have time span from 01.01 to 31.12. They only vary by year.
    • Also, when data are missing (like before July 2021, a xline should be drawn on 1 July 2021. Before, graph should not have any data, since they are missing.
    • Idem for 1 August 2023 onwards. An xline should be drawn. From 01 August onwards data are missing.
    Dataex:


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double(Date MaxPriceMWh CompetitivePriceMWh RealPrice)
    1.9407168e+12 110.079 109.819 91.99
    1.9407204e+12 110.079 109.819 91.26
     1.940724e+12 110.079 109.819 91.65
    1.9407276e+12 110.079 109.819 91.99
    1.9407312e+12 110.079 109.819 91.99
    1.9407348e+12 110.579 110.479 92.34
    1.9407384e+12 110.579 110.579 95.95
     1.940742e+12 110.579 110.579 98.19
    1.9407456e+12 110.579 110.259  96.4
    1.9407492e+12 110.079 110.039 94.93
    1.9407528e+12 110.079 109.819 93.25
    1.9407564e+12 110.079 109.819    93
      1.94076e+12 110.079 109.819 90.19
    1.9407636e+12 110.079 109.819 85.67
    1.9407672e+12 110.079 109.819    85
    1.9407708e+12 110.079 109.819 84.04
    1.9407744e+12 110.079 109.819 89.14
     1.940778e+12 110.079 109.819    93
    1.9407816e+12 110.079 109.819 95.24
    1.9407852e+12 110.579 110.579 95.93
    1.9407888e+12 111.079 110.579 95.54
    1.9407924e+12 111.079 110.579 96.18
     1.940796e+12 110.579 110.479 91.99
    1.9407996e+12 110.579 110.479   100
    1.9408032e+12 111.106 110.706 99.72
    end
    format %tc Date

    Thank you very much.

    Michael
    Last edited by Michael Duarte Goncalves; 06 Nov 2023, 04:08.
Working...
X