With the following Code
, I generate various ListLinePlot
s but I like to create the example
figure given below:
ClearAll[data, time];
SeedRandom[21];
data = RandomReal[{1, 100}, {24, 12}];
time = Transpose@{{2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021}};
data1 = PrependTo[data, time // Flatten] // Transpose;
plot1 = ListLinePlot[Transpose[data1][[{2, 3}]], PlotLegends -> {2, 3}];
plot2 = ListLinePlot[Transpose[data1][[{4, 5}]], PlotLegends -> {4, 5}];
plot3 = ListLinePlot[Transpose[data1][[{6, 7}]], PlotLegends -> {6, 7}];
plot4 = ListLinePlot[Transpose[data1][[{8, 9}]], PlotLegends -> {8, 9}];
Row[{plot1, plot2, plot3, plot4}]
In the data matrix data1
the first column is X-axis denoting time (2010, 2011,...,2021) and is common for all countries. For simplicity, the data in the 2nd and 3rd columns represent country 1
for two time-series variables; and the 4th and 5th columns, country 2
; etc. I have 12 countries consistent with the data given. There are two labels: blue and orange with names Label 1
and Label 2
as in the example.
This is the plot I like to produce:
ResourceFunction["PlotGrid"]
$\endgroup$Grid
is not really creating the type of plot shown in the example. Thanks $\endgroup$