I have 23 variables (energy production units) which take values for each hour of the day (energy dispatch table). Here is a PasteBin example of data. I am trying to represent the distribution of the total energy production for each hour. So far I have managed a pretty decent plot using :
accunits = Table[Accumulate[Transpose[allunits][[k]]], {k, Range[24]}];
ListLinePlot[Transpose[accunits], PlotRange -> All, AxesOrigin -> {1, 0}, ImageSize -> 500, Filling -> colors, PlotStyle -> Opacity[0]]
I still don't fully understand the proper use of FillingStyle
with ColorData
, so I created a list :
colors = Join[
Table[i -> {{i + 1}, Yellow}, {i, 1, 3}],
Table[i -> {{i + 1}, Orange}, {i, 4, 8}],
Table[i -> {{i + 1}, Red}, {i, 9, 15}],
Table[i -> {{i + 1}, Brown}, {i, 16, 20}],
{21 -> {{22}, Blue}},
{22 -> {{23}, Green}}];
Note the two last units are hydro and renewables, so the color scheme is different, while the 21 other units are thermal, so I tried to recreate a simplified TemperatureMap
. This gives me the following image
My question(s) is:
How can I refine the plot so that the lines between colored regions don't appear so aliased and so that the space between the x-axis and the first unit is also colored? Also, how can I apply a temperature color scheme independent of the number of thermal units (the last two units are always hydro/blue and renewables/green)?
EDIT 1 : I found a solution for the coloring of the first unit, by adding a list of zeros as a first "unit" (I had to change the colors
list to take into account this extra first "unit"):
accunits2 = Table[Accumulate[Transpose[Prepend[allunits2[[i, j]], Table[0, {p, Range[24]}]]][[k]]], {k,Range[24]}]
Cheers, E
PlotRangePadding->0
doesn't seem to work for the white space. A workaround I found is to add a list of 0s as a "first unit".accunits2 = Table[Accumulate[Transpose[Prepend[allunits2[[i, j]], Table[0, {p, Range[24]}]]][[k]]], {k,Range[nh]}];
edit : The comment I'm referring to was removed. $\endgroup$ – Emy Feb 7 '13 at 13:59colors = Join[colors, {1 -> {Axis, Yellow}}]
. $\endgroup$ – kglr Feb 7 '13 at 14:10allunits2
the same asallunits
in your code? What isnh
? $\endgroup$ – halirutan♦ Feb 7 '13 at 14:11nh
is just the number of periods (hours) I will change it in my original question as well. $\endgroup$ – Emy Feb 7 '13 at 14:16