Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: PairedBarChart "Education and Training pay..."
Replies: 2   Last Post: Jan 18, 2012 5:59 AM

 Gilmar Rodriguez-pierluissi Posts: 18 Registered: 5/4/11
Re: PairedBarChart "Education and Training pay..."
Posted: Jan 18, 2012 5:59 AM

The following is in reference to:

http://forums.wolfram.com/mathgroup/archive/2012/Jan/msg00040.html

First of all; I want to thank Dr.MajorBob and Tomas Garza for their valuable help!

I have modified Bobby's code (to get closer to my goal of producing the chart) as follows:

labelRates = {"14.9 %", "10.3 %", "9.2 %", "7.0 %", "5.4 %", "4.0 %", "2.4 %", "1.9 %"};

rates = ToExpression@StringReplace[labelRates, " %" -> ""];

n = Length@rates;

labelEarnings = {"\$23,088", "\$32,552", "\$37,024", "\$39,884", "\$53,976", "\$66,144", "\$83,720", "\$80,600"};

earnings = ToExpression@StringReplace[labelEarnings, "\$" | "," -> ""];

labels = {"Some high school,\nno diploma","High school graduate", "Some college,\nno degree","Associate degree", "Bachelor's degree", "Master's degree","Professional degree","Doctoral degree"};

vs = 3.8; (*vertical scale*)

lw = 17; (*label \width*)

es = 4000; (*earnings scale*)

max = Max@earnings;

(**Please; ignore some of the underlining done automatically by my e-mail software **)

educationandtrainingchart =
Graphics@{Transpose@{Range@n, labelRates, rates, labels, earnings, labelEarnings}/. {k_, lr_, r_, l_, e_, le_} :>
{Style[Text[lr, {-r - lw/5, vs (k + .25)}], Bold, Medium, FontFamily -> "Times"],
EdgeForm[Thick], Black, Pink, Rectangle[{-r, k vs}, {0, vs (k + .5)}],
EdgeForm[Thick], Black, Style[Text[l, {lw/2, vs (k + .2)}], Bold, Medium,
FontFamily -> "Times"], Green, Rectangle[{lw, k vs}, {lw + e/es, vs (k + .5)}], EdgeForm[Thick], Black, Style[Text[le, {lw*1.25 + e/es, vs (k + .25)}], Bold, Medium], FontFamily -> "Times"},
{Black, Opacity[0.5], Thick, Line@{{0, vs}, {0, vs (n + .5)}}, Line@{{lw, vs},
{lw, vs (n + .5)}}},
Inset[Text[Style[Framed["Education and Training pay..."], 16, Black, Bold,
Background -> Lighter[Yellow]]], Offset[{100, 360}, {0, 0}]],
Inset[Text[Style["Unemployment Rate in 2010 (Percent)", Medium, Bold,
FontFamily -> "Times"]], Offset[{-150, 320}, {0, 0}]],
Inset[Text[Style["Median Earnings in 2010 (Dollars)", Medium, Bold,
FontFamily -> "Times"]], Offset[{270, 320}, {0, 0}]], ImageSize -> 1000}

After evaluating the above code and the chart is rendered by Mathematica;
the chart appears all "crumbled up" so; I used the chart's window handles
to expand the chart within the Mathematica notebook.

Unfortunately; when I attempt to export it via:

Export["C:\\Temp\\educandtrainingpay.jpg", educationandtrainingchart]

The chart image is still all crumbled up. How can I fix this problem so that
the chart's image is exported correctly?

Thank you!

Gilmar Rodriguez Pierluissi