In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to modify the Excel adjustment chart after matplot code configuration, I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Preface
This is still the process note I was preparing for the visualization column, and the theme is still imitating a variety of unconventional charts, mostly in the matplotlib package.
However, some partners said that using matplotlib is too tedious, and the amount of code is very large.
I quite agree, so I made some tools and code bases that can greatly simplify the code.
This time, we first introduce the configuration table tool. To put it bluntly, you no longer need to write code for the hard configuration on the chart, just go to the excel to configure it:
When using it, you only need to select 1 in the enable column.
Column D to the right, is a fixed configuration, once configured, it does not need to be changed in the future (some of which involve numerical configuration items, which need to be adjusted according to)
It means that future adjustments to the details of the chart can be reused directly at the configuration level!
Next, a brief introduction to how to use.
The tool requires a package I made:
Tools are included in: data Universe > tools > Visualization
No longer need to remember all kinds of attributes.
Using the goal chart in the previous section, you have drawn the three graphs you need:
Stacking diagram
The rectangle below the x axis
The bubble chart below and for the label
At this point, there is still some detail gap between the chart and the goal. Compare the following figure:
On the left is the target, on the right is the current situation.
What is missing is some detail processing such as axes, scales, data area borders and lines. This is often a necessary part of an unconventional chart.
These things are tedious, there is no principle to say, rely solely on the memory of the document.
There is no need for us to waste energy on it.
Therefore, I put all these property settings into Excel, through configuration.
First, list the points that need to be modified:
The left and upper data frames are cancelled, tick marks and tick marks are cancelled.
Move the y-axis to the right
X-axis lock intersects with y-axis 0
The lines and scales of the y axis only show those above 0
Find the corresponding configuration in Excel, and fill in 1 in the "Startup" column:
The "remarks" column, according to your own understanding, can be written at will, even blank.
How does the code work?
Line 14: import classes
Line 16: instantiate the TabelConf object, where you can set the path to the configuration table and the worksheet name (the default is the same as pandas.read_excel)
Line 17: use the object to call directly, and pass in the axes object during the call
You can modify the configuration of Excel at any time, save it, re-execute the calling code, and you can see the effect immediately.
The implementation results are as follows:
Highlight:
You can configure multiple charts, or apply the same configuration to multiple charts. Use it as much as you like.
You may find that you are free to add your own configuration to it, and to put it bluntly, every line of the configuration will be executed dynamically.
Later, I will update the configuration used in the production process of this series.
"however, it takes a lot of code to make stacking diagrams, bubble diagrams and labels!"
After reading the above, have you mastered how to modify the Excel adjustment chart after matplot code configuration? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.