Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to cancel the default display of dots when pyecharts draws a map

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you how to cancel the pyecharts map when the default display of dots mark the relevant knowledge points, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you have something to gain after reading this article, let's take a look at it.

1 problem

When using pyecharts to draw visual map information, the default image is marked with dots, such as the official website code.

The output is as follows:

2 problem solving

Method 1: showLegendSymbol=False

Ts import options as optsfrom pyecharts.chafrom pyecharrts import Mapdata = [['Liaoning', 325], ['Guangdong', 202], ['Zhejiang', 191], ['Jiangsu', 456], ['Shanghai', 76]] C = (Map () .add (", data," china ") .set _ series_opts (label_opts=opts.LabelOpts (is_show=False)) ShowLegendSymbol=False) # whether to display geographic information tags. Set _ global_opts (visualmap_opts=opts.VisualMapOpts (max_=500, is_piecewise=False), # controls whether segmentation or contiguous title_opts=opts.TitleOpts (title= "Geo- basic example") # title)) C.render_notebook ()

The output is as follows: (note that the parameters here are in the first layer of the set_series_opts setting, juxtaposed with the label_opts setting, different from one of the following solutions)

Method 2: itemstyle_opts=opts.ItemStyleOpts (color= "transparent")

From pyecharts import options as optsfrom pyecharts.charts import Mapdata = [['Liaoning', 325], ['Guangdong', 202], ['Zhejiang', 191], ['Jiangsu', 456], ['Shanghai', 76]] C = (Map () .add (", data," china ") .set _ series_opts (label_opts=opts.LabelOpts (is_show=False)) # whether to display the geographic information tag itemstyle_opts=opts.ItemStyleOpts (color= "transparent") .set _ global_opts (visualmap_opts=opts.VisualMapOpts (max_=500, is_piecewise=False), # Control Segmentation or continuous title_opts=opts.TitleOpts (title= "Geo- basic example") # graphic title)) C.render_notebook ()

The output result is as follows: (note that the identification is removed by making the color transparent. The parameters are under itemstyle_opts and belong to the settings in the second layer, which should be distinguished from the position of the first method.)

These are all the contents of the article "how to cancel the default display of dots when pyecharts draws a map". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report