I was looking for the .src file that went with the wage plot on the github GAUSS graphics site. I wanted to make a plot like the one on the right (with different colors for the boxes in the boxplot) AND with character labels on the X-axis. Thanks
1 Answer
0
This is a modified version of the plotbox.e
example file that comes with GAUSS. It will draw text labels on the X-axis and use a different color for every box.
new;
cls;
// Simulate some reasonable data
temp_september = 4 .* rndn(30, 1) + 80;
temp_october = 2 .* rndn(30, 1) + 70;
// Declare and fill plotControl structure with defaults
struct plotControl myPlot;
myPlot = plotGetDefaults("box");
// Set title and axis labels
plotSetTitle(&myPlot, "Seattle high temperatures", "Arial", 20);
plotSetYLabel(&myPlot, "Degrees (F)", "Arial", 14);
plotSetTicLabelFont(&myPlot, "Arial", 14);
// Plot each column as a separate group
// which will give it a separate color and
// legend entry
ungroup = 1;
plotSetGroupingBehavior(&myPlot, ungroup);
// Create string labels for boxes
months = "September" $| "October";
// Draw box plot
plotBox(myPlot, months, temp_september~temp_october);
Your Answer
1 Answer
0
This is a modified version of the plotbox.e
example file that comes with GAUSS. It will draw text labels on the X-axis and use a different color for every box.
new;
cls;
// Simulate some reasonable data
temp_september = 4 .* rndn(30, 1) + 80;
temp_october = 2 .* rndn(30, 1) + 70;
// Declare and fill plotControl structure with defaults
struct plotControl myPlot;
myPlot = plotGetDefaults("box");
// Set title and axis labels
plotSetTitle(&myPlot, "Seattle high temperatures", "Arial", 20);
plotSetYLabel(&myPlot, "Degrees (F)", "Arial", 14);
plotSetTicLabelFont(&myPlot, "Arial", 14);
// Plot each column as a separate group
// which will give it a separate color and
// legend entry
ungroup = 1;
plotSetGroupingBehavior(&myPlot, ungroup);
// Create string labels for boxes
months = "September" $| "October";
// Draw box plot
plotBox(myPlot, months, temp_september~temp_october);