![]() text (x, y, country, fontsize = 12 ) ) # Adjust text position and add lines - # 'expand_points' is a tuple with two multipliers by which to expand # the bounding box of texts when repelling them from points # 'arrowprops' indicates all the properties we want for the arrows # arrowstyle="-" means the arrow does not have a head (it's just a line!)Īrrowprops = dict (arrowstyle = "-", lw = 1 ) , TEXTS = for idx, country in enumerate (COUNTRIES ) : # Only append selected countries if country in COUNTRY_HIGHLIGHT : # This list is passed to `adjust_text()` to adjust the position of # the legends and add connecting lines # Countries that are going to be highlightedĬOUNTRY_HIGHLIGHT = # Add labels - # Iterate through all the countries in COUNTRIES # `ax.text()` outputs are appended to the `TEXTS` list. # Specify countries - # All the countries, in the order they appear in the datasetĬOUNTRIES = corrupt. Handletextpad = 0.6, # Space between text and marker/lineįrameon = False ) # Set transparency - # Iterate through first five handles and set transparency for i in range ( 5 ) : ![]() Handles +=, , label = "y ~ log(x)", color = "#696969", lw = 2 ) ] # Add legend -ībox_to_anchor =, # Located in the top-mid of the figure. Markerfacecolor =REGION_COLS, # marker fill color ) for idx, label in enumerate (REGIONS ) ] # Append a handle for the line ![]() Lw = 0, # there's no line added, just the marker # Create handles - # Region names with linebreaks for the long ones
0 Comments
Leave a Reply. |