I'm trying to format my bar charts so that I have only specific ticks with specific labels, and I can't seem to figure out how to do this. It always either comes up with ticks on every bar or without the labels I want. I'm also trying to make the chart 1/3 the automatic height with the same (automatic) width and having some trouble figuring out how to do that. If anyone can help me, it would be greatly appreciated.
I have 56 bars representing data from each year of 1960 to 2015, inclusive. I want ticks on bars 1, 11, 21, 31, 41, and 51 with labels 1960, 1970, 1980, 1990, 2000, and 2010 respectively. In case it's helpful, I'm putting the code for the charts below.
Regarding the size, the essence of what I'm doing is having a line plot on the left, and to the right of it, I'm placing three bar charts, each on top of the other. I need each bar chart to be 1/3 the height but the same width of the line plot, stacked in this way. Preferably, each bar graph should have its own y-axis label (the A, B, or C) with one communal label ("Fraction of Publications"), and only the bottom bar graph should have the year labels. I've tried to use a graphics grid to no avail. Do you have any ideas on what I should use. Current code is below.
Code is enclosed in a do loop which increments i
.
Print[Show[BarChart[
dataset1,
PlotLabel -> labels[[i]] <> " A",
FrameLabel -> {{"Fraction of Publications", None}, {"Year",
None}},
ChartStyle -> {{Red}, {EdgeForm[]}},
BaseStyle -> {FontFamily -> "Ariel", FontSize -> 10},
Frame -> False,
PlotRange -> {0,
Max[alldata]}]]];
Print[Show[BarChart[
dataset2,
PlotLabel -> labels[[i]] <> " B",
FrameLabel -> {{"Fraction of Publications", None}, {"Year",
None}},
ChartStyle -> {{Blue}, {EdgeForm[]}},
BaseStyle -> {FontFamily -> "Ariel", FontSize -> 10},
Frame -> False,
PlotRange -> {0,
Max[alldata]}]]];
Print[Show[BarChart[
dataset3,
PlotLabel -> labels[[i]] <> " C",
FrameLabel -> {{"Fraction of Publications", None}, {"Year",
None}},
ChartStyle -> {{Purple}, {EdgeForm[]}},
BaseStyle -> {FontFamily -> "Ariel", FontSize -> 10},
Frame -> False,
PlotRange -> {0,
Max[alldata]}]]
EDIT: I'm looking to make the ticks look somewhat like the ones in this line plot:
EDIT2: Here's the updated code I'm working with now based on some helpful suggestions:
Print[Show[GraphicsColumn[{Show[BarChart[
dataset1,
FrameLabel -> {{"A", None}, {None, None}},
ChartStyle -> {{Red}, {EdgeForm[]}},
BaseStyle -> {FontFamily -> "Arial", FontSize -> 10},
Frame -> {{True, None}, {None, None}},
PlotRange -> {0,
Max[alldata]}]],
Show[BarChart[
dataset2,
FrameLabel -> {{"B", None}, {None, None}},
ChartStyle -> {{Blue}, {EdgeForm[]}},
BaseStyle -> {FontFamily -> "Arial", FontSize -> 10},
Frame -> {{True, None}, {None, None}},
PlotRange -> {0,
Max[alldata]}]],
Show[BarChart[
dataset3,
FrameLabel -> {{"C", None}, {None, None}},
Frame -> {{True, None}, {None, None}},
ChartStyle -> {{Purple}, {EdgeForm[]}},
BaseStyle -> {FontFamily -> "Arial", FontSize -> 10},
PlotRange -> {0,
Max[alldata]}]]} ,
PlotLabel -> labels[[i]]],
Frame -> True,
FrameLabel -> {{"Fraction of Publications", None}, {"Year", None}},
FrameTicks -> None,
BaseStyle -> {FontFamily -> "Arial", FontSize -> 10}]]
However, it's giving me a weird product. Example:
Note, I would prefer if it didn't have the frame around it, though were the frame placed correctly, I suppose I could remove it in Photoshop if need be.