Keywordsdata visualization python python data visualization
In today's information explosion era, how to gather a large amount of information and a small chart, let people make judgments at a glance, and easily convey complex views will be the primary proposition for data workers. To do good things, we must first sharpen our tools. matplotlib is a powerful tool for
python visualization. I have matplotlib in hand, drawing pictures.
So let's take a look at what classic charts matplotlib has?
1. Comparing single-cell processing analysis Scanpy uses matplotlib to combine the violin diagrams of multiple genes beautifully.
2. Deeptools' classic heatmap and lineProfile are carefully crafted by the Google team using matplotlib~~
3. GenomeTrack, the 3D genome artifact, uses matploltlib to perfectly perform joint visualization and comparison of multi-omics.
In addition, we can also use matplotlib to create some charts that combine elegance and intelligence~~
Now that we understand what matplotlib (https://matplotlib.org/gallery/index.html) can do, how do we get started with matplotlib? Then you need to start with two big pieces: one is the basic chart, and the other is the layout. Drawing is like placing a plate, the chart is like the ingredients, and the layout is like you need to figure out where to put the ingredients.
Depends on the grammar of all the basic graphics covered by matplotlib, which requires you to go to the official website of matplotlib to see what its warehouse (https://matplotlib.org/gallery/index.html#gallery) has.
The basic chart elements of matplotlib include Figure, title, legend, ticks, labels (as shown below)
So, how do these elements correspond to the chart? Let’s take a look at the following "chestnuts"~~
The first step is to import the matplotlib package in your python script.
Looking at the basic chart, let’s look at the second block of matplotlib-the basic layout
First, you can use add_axes to place your chart, use left and bottom to determine the position of the lower left corner of the subgraph in the entire chart, and use the lower left point to extend to the right (width) and downward (height) to determine the chart size.
Second: For complex layouts, gridspec is so easy to use, it can't be used any more!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.