Hi everyone,
I would like to use the command -geoplot- at the municipal level in Spain. However, I obtained a very ugly graph, and I don't know why.
Previously, I used this command to Provinces data, and it works well.
But now, I don't understand what is going on.
Here is my code:
My graph, where the colours have nothing to do with the data! 
Please, I need your help.
Thank you so much in advance.
Best,
Michael
Edit: By the way, is there a form I can put the Canary Islands next to my main map please, like a small nice box with Canary Islands near to the Iberian Peninsula, please? Thank you.
I would like to use the command -geoplot- at the municipal level in Spain. However, I obtained a very ugly graph, and I don't know why.
Previously, I used this command to Provinces data, and it works well.
But now, I don't understand what is going on.
Here is my code:
Code:
*******Map at the municipal level: global stata "C:/Users/miduarte/Desktop/Ongoing_Projects/test_HolaLuz_Data/New_dataset_15112023/stata" global export_geopath "C:/Users/miduarte/Desktop/Ongoing_Projects/test_HolaLuz_Data/New_dataset_15112023/stata/1_export_contratos/data/mapping_data/lineas_limite/SHP_ETRS89" spshape2dta "${export_geopath}/recintos_autonomicas_inspire_peninbal_etrs89/recintos_autonomicas_inspire_peninbal_etrs89.shp", replace saving(Spain_auton) spshape2dta "${export_geopath}/recintos_provinciales_inspire_peninbal_etrs89/recintos_provinciales_inspire_peninbal_etrs89.shp", replace saving(Spain_provinc) spshape2dta "${export_geopath}/recintos_municipales_inspire_peninbal_etrs89/recintos_municipales_inspire_peninbal_etrs89.shp", replace saving(Spain_municip) spshape2dta "${export_geopath}/recintos_municipales_inspire_peninbal_etrs89/PCODE_2020_PT_SH.shp", replace saving(Spain_postalcodes) clear all cd ${export_geopath} use Spain_postalcodes, clear drop if CNTR_ID !="ES" sort POSTCODE rename POSTCODE sp_zipcode_str save Spain_postalcodes.dta, replace *1)Creation of Provincias limits geoframe create Spain_provinc, replace geoframe describe Spain_provinc *2)Creation of Municipal limits geoframe create Spain_postalcodes, replace geoframe describe Spain_postalcodes *3)Some data cleaning, if needed geoframe describe Spain_postalcodes_shp merge 1:1 sp_zipcode_str using `house_info_munic', keep(match) nogenerate save Spain_postalcodes, replace *4)Creation of CCAA limits geoframe create Spain_auton geoframe describe Spain_auton_shp *5)Creation of collapse connexion geoframe create "${stata}/1_export_contratos/data/mapping_data/house_info_collapse_municipalities", replace geoframe describe house_info_collapse_municipaliti geoplot /// (area Spain_postalcodes obs_by_zipcode_house_mun, color(tableau)) /// (line Spain_provinc, lwidth(0.4)) /// , tight legend(pos(9))
Please, I need your help.
Thank you so much in advance.
Best,
Michael
Edit: By the way, is there a form I can put the Canary Islands next to my main map please, like a small nice box with Canary Islands near to the Iberian Peninsula, please? Thank you.
Comment