Design the WeChat Logo from Scratch Using Python and Matplotlib
This tutorial walks you through creating the classic green WeChat logo with Python's Matplotlib library, covering canvas setup, logo component analysis, and step‑by‑step code for ellipses, eyes, and arrows to produce a complete graphic.
Overall Canvas Design
The tutorial uses Python (Anaconda) on Windows 7 and relies on Matplotlib for drawing. First, import the necessary libraries and configure a square canvas with a green background matching the WeChat logo color, removing axis ticks.
Analyzing the Logo
The WeChat logo consists of three parts: two overlapping ellipses (one larger left, one smaller right), four small circles representing the "eyes" of each ellipse, and two arrows—left arrow on the left ellipse and right arrow on the right.
Drawing the Ellipses
Code for the two ellipses:
es1 = Ellipse([15,24], width=21, height=18, facecolor='white', zorder=1) es2 = Ellipse([26,16], width=18, height=15, facecolor='white', linewidth=5, edgecolor=color, zorder=1)Both ellipses are placed on the canvas; the second is drawn after the first so it appears on top.
Drawing the Eyes
Four small circles are added, symmetric to the ellipses' central lines, with the left eye larger than the right. All eyes are colored green.
Drawing the Arrows
The arrows are created using sector shapes (pie wedges) whose central angles act as arrowheads, simplifying coordinate handling. This method allows precise control of the arrow direction and size.
Final Result
The completed WeChat logo is rendered on the green canvas. A variant with different colors (left ellipse #A1CC3F, right ellipse #E9E9E9, black eyes, white background) can be produced by adjusting the color parameters.
The example demonstrates that Matplotlib is well‑suited for simple graphic design tasks, allowing beginners to create recognizable icons with only a few lines of code.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
