I am working with vehicle data attempting to produce a pie chart by body style and fuel type. My problem is my fossil fuel category dominates the pie chart hindering any ability to distinguish the other categories. So far I have
What I would like to do, if possible is have one pie chart for fossil fuels by body style and next to that the remaining fuel types by body style.
Below is example code.
Thank you for your time.
Adam
Code:
graph pie vehicles if datayear == 2013, over(fuel_type) plabel(_all percent) by(, title(`"Percent of Vehicles by Body Style and Fuel Type for 2013"')) by( body_style )
Below is example code.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int datayear str16 fuel_type str13 body_style double vehicles float fuel_type_dum 2013 "Alternative" "Convertible" 347 0 2014 "Alternative" "Convertible" 556 0 2015 "Alternative" "Convertible" 823 0 2016 "Alternative" "Convertible" 1086 0 2017 "Alternative" "Convertible" 1237 0 2018 "Alternative" "Convertible" 1263 0 2019 "Alternative" "Convertible" 1238 0 2020 "Alternative" "Convertible" 1227 0 2013 "Alternative" "Coupe" 324 0 2014 "Alternative" "Coupe" 487 0 2015 "Alternative" "Coupe" 622 0 2016 "Alternative" "Coupe" 804 0 2017 "Alternative" "Coupe" 972 0 2018 "Alternative" "Coupe" 1128 0 2019 "Alternative" "Coupe" 1290 0 2020 "Alternative" "Coupe" 1401 0 2013 "Alternative" "Passenger Van" 13124 0 2014 "Alternative" "Passenger Van" 14313 0 2015 "Alternative" "Passenger Van" 15348 0 2016 "Alternative" "Passenger Van" 16352 0 2017 "Alternative" "Passenger Van" 17425 0 2018 "Alternative" "Passenger Van" 17864 0 2019 "Alternative" "Passenger Van" 18272 0 2020 "Alternative" "Passenger Van" 18659 0 2013 "Alternative" "Pickup Truck" 10741 0 2014 "Alternative" "Pickup Truck" 12738 0 2015 "Alternative" "Pickup Truck" 13883 0 2016 "Alternative" "Pickup Truck" 14974 0 2017 "Alternative" "Pickup Truck" 15935 0 2018 "Alternative" "Pickup Truck" 16386 0 2019 "Alternative" "Pickup Truck" 16613 0 2020 "Alternative" "Pickup Truck" 16753 0 2013 "Alternative" "SUV" 34979 0 2014 "Alternative" "SUV" 42154 0 2015 "Alternative" "SUV" 55112 0 2016 "Alternative" "SUV" 69425 0 2017 "Alternative" "SUV" 79936 0 2018 "Alternative" "SUV" 87234 0 2019 "Alternative" "SUV" 91713 0 2020 "Alternative" "SUV" 95548 0 2013 "Alternative" "Sedan" 17459 0 2014 "Alternative" "Sedan" 19262 0 2015 "Alternative" "Sedan" 21487 0 2016 "Alternative" "Sedan" 23447 0 2017 "Alternative" "Sedan" 23841 0 2018 "Alternative" "Sedan" 23092 0 2019 "Alternative" "Sedan" 22274 0 2020 "Alternative" "Sedan" 21319 0 2013 "Alternative" "Wagon" 440 0 2014 "Alternative" "Wagon" 398 0 2015 "Alternative" "Wagon" 363 0 2016 "Alternative" "Wagon" 331 0 2017 "Alternative" "Wagon" 301 0 2018 "Alternative" "Wagon" 254 0 2019 "Alternative" "Wagon" 234 0 2020 "Alternative" "Wagon" 201 0 2013 "Battery Electric" "Convertible" 22 0 2014 "Battery Electric" "Convertible" 22 0 2015 "Battery Electric" "Convertible" 23 0 2016 "Battery Electric" "Convertible" 23 0 2017 "Battery Electric" "Convertible" 22 0 2018 "Battery Electric" "Convertible" 19 0 2019 "Battery Electric" "Convertible" 18 0 2020 "Battery Electric" "Convertible" 17 0 2013 "Battery Electric" "Coupe" 20 0 2014 "Battery Electric" "Coupe" 29 0 2015 "Battery Electric" "Coupe" 45 0 2016 "Battery Electric" "Coupe" 40 0 2017 "Battery Electric" "Coupe" 44 0 2018 "Battery Electric" "Coupe" 33 0 2019 "Battery Electric" "Coupe" 31 0 2020 "Battery Electric" "Coupe" 40 0 2013 "Battery Electric" "Hatchback" 70 0 2014 "Battery Electric" "Hatchback" 447 0 2015 "Battery Electric" "Hatchback" 761 0 2016 "Battery Electric" "Hatchback" 1213 0 2017 "Battery Electric" "Hatchback" 1554 0 2018 "Battery Electric" "Hatchback" 2307 0 2019 "Battery Electric" "Hatchback" 2835 0 2020 "Battery Electric" "Hatchback" 3164 0 2013 "Battery Electric" "Passenger Van" 1 0 2016 "Battery Electric" "Pickup Truck" 1 0 2017 "Battery Electric" "Pickup Truck" 1 0 2018 "Battery Electric" "Pickup Truck" 1 0 2020 "Battery Electric" "Pickup Truck" 1 0 2017 "Battery Electric" "SUV" 159 0 2018 "Battery Electric" "SUV" 349 0 2019 "Battery Electric" "SUV" 532 0 2020 "Battery Electric" "SUV" 884 0 2013 "Battery Electric" "Sedan" 1 0 2014 "Battery Electric" "Sedan" 1 0 2015 "Battery Electric" "Sedan" 1 0 2016 "Battery Electric" "Sedan" 2 0 2017 "Battery Electric" "Sedan" 3 0 2018 "Battery Electric" "Sedan" 3 0 2019 "Battery Electric" "Sedan" 1035 0 2020 "Battery Electric" "Sedan" 2347 0 2013 "Fossil Fuels" "Convertible" 69565 1 2014 "Fossil Fuels" "Convertible" 68027 1 2015 "Fossil Fuels" "Convertible" 66982 1 end
Adam
Comment