Nerd For Tech
Published in

Nerd For Tech

How to Embed Code in Medium

Two easy methods for embedding code in your Medium article.

Method 1: Embed directly in medium

  • Mac : Command+ Option+6
  • Windows: Control + Alt + 6
  • Linux: Control + Alt + 6
<Enter your code here>
#Title                        
plt.title(f"G 20 Countries : {abbr['gni_pc']} vs {abbr['life_ex']}")
# x and y axis labels plt.xlabel(abbr['gni_pc']) plt.ylabel(abbr['life_ex']) #Country names
for i in range(hdi_df.shape[0]):
plt.text(df.gni_pc[i], y=df.life_ex[i], s=df.Country[i]))

Method 2: Embed using Github Gist

Image by author
Image by author
Image by author
Image by author

Video Format

--

--

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store