code for wage plot on github

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


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.


// 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);

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy