17 brands, 113 5G mobile phones, 5G is getting closer and closer to us

Author | Little F

Source | Farnast (ID: walker398)

Head picture | CSDN download from Oriental IC

The iPhone 12 was released a few days ago, and Apple finally launched its first 5G mobile phone.

The lowest price was 5499 yuan, and the poor little F decided to give up , haha~

"The Paper Art Class" also released a tweet about 5G mobile phones.

It visualizes related data such as 5G mobile phone prices and chips , 5G download speeds , and 5G network cities .

The analysis is also very reasonable, so this issue will use their data to reproduce it.

The three types of graphs, pictograms , bar graphs , and maps , are all implemented with Pyecharts.

After a year, Little F met it again.

The 0.5 version was used before, and the latest version of Pyecharts is 1.8.1.

Determine the latest version and start the journey of gnawing documents again~

Price comparison of various brands of 5G mobile phones

There are a total of 17 brands, of which realme is an emerging mobile phone brand, only established in 2018.

And the price of a 5G mobile phone it produced was as low as 1,000 yuan .

The 5G experience machine, I’m afraid I won’t get it~

from pyecharts.charts import PictorialBar
from pyecharts import options as opts


# 品牌名称
label = ['华硕', '联想', '摩托罗拉', '魅族', '黑鲨', '努比亚', '中兴', '一加', '小米', 'IQOO', '红米', '三星', 'realme', 'OPPO', '荣耀', 'vivo', '华为']




def pic_bar_price(values, label):
    """
    5G手机价位比较
    """
    # 初始化,设置图表大小
    pictorialbar = PictorialBar(init_opts=opts.InitOpts(width='480px', height='700px'))
    # x轴标签信息
    pictorialbar.add_xaxis(label)
    # 添加象形图
    pictorialbar.add_yaxis("",
        values[0],
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0,0],
        is_symbol_clip=True,
        symbol='rect',
        color='#FCA46A',
        gap='-100%',
        symbol_margin=10,
        label_opts=opts.LabelOpts(is_show=False)
    )
    pictorialbar.add_yaxis("5000元及以上",
        values[1],
        symbol_size=18,
        label_opts=opts.LabelOpts(is_show=False),
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='#F95DBA',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.add_yaxis("3000-4999元",
        values[2],
        label_opts=opts.LabelOpts(is_show=False),
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='#4E70F0',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.add_yaxis("1000-2999元",
        values[3],
        yaxis_index=0,
        label_opts=opts.LabelOpts(is_show=False),
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='#1720D1',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.add_yaxis("999元及以下",
        values[4],
        yaxis_index=0,
        label_opts=opts.LabelOpts(is_show=False),
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='white',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.set_global_opts(
        # 隐藏x坐标轴
        xaxis_opts=opts.AxisOpts(is_show=False),
        # 显示y坐标轴,隐藏刻度线
        yaxis_opts=opts.AxisOpts(is_show=True, axistick_opts=opts.AxisTickOpts(is_show=False)),
        # 显示图例,设置图例位置
        legend_opts=opts.LegendOpts(pos_bottom='9%', pos_right='10%', orient='vertical', item_width=18, item_height=18),
        # 添加标题,设置标题位置
        title_opts=opts.TitleOpts(title='各品牌5G手机价位比较', pos_left='center', pos_top='2%')
    )
    pictorialbar.reversal_axis()
    pictorialbar.render('各品牌5G手机价位比较.html')




values = [
    [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
    [5, 10, 10, 15, 15, 15, 15, 15, 35, 35, 40, 45, 45, 50, 60, 65, 85],
    [0, 10, 5, 15, 15, 15, 15, 10, 25, 35, 40, 10, 45, 40, 60, 50, 55],
    [0, 0, 0, 0, 0, 5, 15, 5, 5, 15, 35, 10, 30, 25, 45, 30, 35],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0]
]
pic_bar_price(values, label)

Use Pyecharts' PictorialBar ( pictorial histogram ) to express the quantity through graphics.

Compared with the chart of the surging art class, the arrangement position is a bit different, and the others are not much different.

One square represents 1 quantity, which means that there are 12 models of Honor brand 5G mobile phones, and one of them is used by the small F~

It can be seen that 1000-2999 yuan (pink) and 3000 yuan and above (blue) are equally divided.

Realme's mobile phone priced at 998 yuan is also outstanding.

Mobile phone chips, mainly Snapdragon , MediaTek Dimensity , Kirin , Samsung Exynos .

from pyecharts.charts import PictorialBar
from pyecharts import options as opts


# 品牌名称
label = ['华硕', '联想', '摩托罗拉', '魅族', '黑鲨', '努比亚', '中兴', '一加', '小米', 'IQOO', '红米', '三星', 'realme', 'OPPO', '荣耀', 'vivo', '华为']




def pic_bar_microchip(values, label):
    pictorialbar=PictorialBar(init_opts=opts.InitOpts(width='480px', height='700px'))
    pictorialbar.add_xaxis(label)
    pictorialbar.add_yaxis("",
        values[0],
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0,0],
        is_symbol_clip=True,
        symbol='rect',
        color='#F95DBA',
        gap='-100%',
        symbol_margin=10,
        label_opts=opts.LabelOpts(is_show=False)
    )
    pictorialbar.add_yaxis("高通骁龙",
        values[1],
        symbol_size=18,
        label_opts=opts.LabelOpts(is_show=False),
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='#FFCE2B',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.add_yaxis("联发科天玑/MT",
        values[2],
        label_opts=opts.LabelOpts(is_show=False),
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='#009688',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.add_yaxis("华为麒麟",
        values[3],
        yaxis_index=0,
        label_opts=opts.LabelOpts(is_show=False),
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='#1720D1',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.add_yaxis("三星Exynos",
        values[4],
        yaxis_index=0,
        label_opts=opts.LabelOpts(is_show=False),
        symbol_size=18,
        symbol_repeat='20',
        symbol_offset=[0, 0],
        is_symbol_clip=True,
        symbol='rect',
        color='white',
        gap='-100%',
        symbol_margin=10
    )
    pictorialbar.set_global_opts(
        xaxis_opts=opts.AxisOpts(is_show=False),
        yaxis_opts=opts.AxisOpts(is_show=True, axistick_opts=opts.AxisTickOpts(is_show=False)),
        legend_opts=opts.LegendOpts(pos_bottom='9%', pos_right='10%', orient='vertical', item_width=18, item_height=18),
        title_opts=opts.TitleOpts(title='各品牌5G手机芯片比较', pos_left='center', pos_top='2%')
    )
    pictorialbar.reversal_axis()
    pictorialbar.render('各品牌5G手机芯片比较.html')




values = [
    [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
    [5, 10, 10, 15, 15, 15, 15, 15, 35, 35, 40, 45, 45, 50, 60, 65, 85],
    [0, 0, 0, 0, 0, 0, 5, 0, 0, 5, 15, 5, 20, 15, 60, 30, 85],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 45, 25, 60],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 25, 0]
]
pic_bar_microchip(values, label)

Snapdragon occupies most of the 5G mobile phone market , and Kirin and MediaTek are on par.

In May of this year, the United States enacted a comprehensively upgraded chip ban on Huawei, and Kirin's current situation is very difficult.

I hope Huawei can hold on. From school to now, Xiao F bought mobile phones for himself or at home, all of which are Huawei brands, a proper pollen~

5G/4G speed comparison of the three major operators

Compared with 4G, 5G has the advantage that the speed becomes faster .

This 5G popular science video that was blasted across the entire network by "Classmate He" last year can also understand one or two things.

In Xiao F's impression, the download speed of the App is about 80-90Mbps.

from pyecharts.charts import Bar
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode


c = (
    Bar()
    # 添加类目轴文本标签
    .add_xaxis(['中 国\n联 通', '中 国\n电 信', '中 国\n移 动'])
    # 添加数值轴,label显示及偏移,颜色渐变,定义不同类型间距(最新版本pyecharts1.8.1)
    .add_yaxis("4G", [22.84, 25.29, 26.6], itemstyle_opts=JsCode('ItemStyleOpts_4G'), label_opts=opts.LabelOpts(is_show=True, formatter=JsCode('label_4G'), position='insideRight', color='black', font_weight='bolder', distance=0, font_size=14), category_gap='70%', gap='20%')
    .add_yaxis("5G", [160.04, 168.39, 284.37], itemstyle_opts=JsCode('ItemStyleOpts_5G'), label_opts=opts.LabelOpts(is_show=True, formatter=JsCode('label_5G'), position='insideRight', color='black', font_weight='bolder', distance=0, font_size=14), category_gap='70%', gap='20%')
    # x/y轴互换位置
    .reversal_axis()
    .set_global_opts(
        # 标题设置
        title_opts=opts.TitleOpts(title='三大运营商的5G/4G速度对比', subtitle='下载网速对比(单位:Mbps)', pos_left='center', pos_top='-1%', item_gap=3),
        # 隐藏图例
        legend_opts=opts.LegendOpts(is_show=False),
        # x轴属性设置,隐藏刻度线和坐标轴,设置分割线(虚线)
        xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(is_show=True, position='10%'),
                                 position='top',
                                 axistick_opts=opts.AxisTickOpts(is_show=False),
                                 axisline_opts=opts.AxisLineOpts(is_show=False),
                                 splitline_opts=opts.SplitLineOpts(is_show=True, linestyle_opts=opts.LineStyleOpts(width=1, opacity=0.5, type_='dotted', color='grey'))
        ),
        # y轴属性设置,隐藏刻度线
        yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(is_show=True, font_size=15, font_weight='normal'), axistick_opts=opts.AxisTickOpts(is_show=False)),


    )
    # 添加标签函数及颜色函数
    .add_js_funcs(
        """
        const label_4G = function(arg) {
            console.log(arg)
            if (arg.data === 26.6) {
                return '4G▐'
            }
            else {
                return '▐'
            }
        }


        const label_5G = function(arg) {
            //console.log(arg)
            if (arg.data === 284.37) {
                return '5G▐'
            }
            else {
                return '▐'
            }
        }


        const ItemStyleOpts_4G = {'color': function(arg) {
            return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
                {
                    offset: 0.01,
                    color: "black",
                },
                {
                    offset: 0.018,
                    color: "white",
                },
                {
                    offset: 1,
                    color: '#F7A1AC',
                }
            ])
        }}


        const ItemStyleOpts_5G = {'color': function(arg) {
            return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
                {
                    offset: 0.001,
                    color: "black",
                },
                {
                    offset: 0.003,
                    color: "white",
                },
                {
                    offset: 1,
                    color: '#4E70F0',
                }
            ])
        }}
        """
    )
    .render("三大运营商的速度对比.html")
)

Here , the native JS function is passed in through the add_js_funcs function of Pyecharts .

In this way, you can customize the label text information and add gradient colors to the histogram .

Modify the Y-axis data to get the upload speed comparison chart.

It can be seen that the download speed of 5G is almost 10 times that of 4G .

But then again, 5G is good, but the package is too expensive.

A few days ago, Telecom also sent text messages, inviting Xiao F to upgrade to 5G.

Take a look at the specific situation of the 5G package.

There is no broadband at 129 yuan, and the traffic is only 30G.

For download speeds like 5G, I feel that the traffic is not enough!

5G Commercial Network City

This list was announced last year, the three major operators, covering 55 cities.

The list of major operators' 5G commercial cities is as follows.

# 电信5G商用城市名单
Telecom = '北京、天津、上海、重庆、石家庄、保定、太原、晋城、呼和浩特、沈阳、大连、长春、哈尔滨、南京、无锡、苏州、杭州、宁波、温州、嘉兴、合肥、芜湖、福州、厦门、泉州、南昌、鹰潭、济南、青岛、郑州、南阳、武汉、长沙、株洲、广州、深圳、佛山、东莞、南宁、柳州、海口、琼海、成都、贵阳、昆明、西安、兰州、西宁、银川、乌鲁木齐'


# 移动5G商用城市名单
Mobile = '北京、天津、上海、重庆、石家庄、保定、太原、晋城、呼和浩特、沈阳、大连、长春、哈尔滨、南京、无锡、苏州、杭州、宁波、温州、嘉兴、合肥、芜湖、福州、厦门、泉州、南昌、鹰潭、济南、青岛、郑州、南阳、武汉、长沙、株洲、广州、深圳、佛山、东莞、柳州、南宁、海口、琼海、成都、贵阳、昆明、西安、兰州、西宁、银川、乌鲁木齐、'


# 移动5G商用城市名单
Unicom = '北京、上海、广州、深圳、杭州、南京、天津、武汉、济南、郑州、苏州、青岛、重庆、成都、宁波、温州、嘉兴、绍兴、东莞、佛山、中山、珠海、无锡、常州、南通、沈阳、长沙、大连、兰州、福州、石家庄、太原、西宁、西安、厦门、贵阳、保定、呼和浩特、南宁、海口、哈尔滨、南昌、合肥、银川、昆明、长春、泉州、柳州、鹰潭、乌鲁木齐、'

Little F's hometown is not on the list, but his place of work is on the list.

Turn on the 5G switch of the phone, there is a 5G signal, but the 5G package is not activated, and it is useless~

from pyecharts.commons.utils import JsCode
from pyecharts import options as opts
from pyecharts.charts import Geo
from collections import Counter


# 电信5G商用城市名单
Telecom = '北京、天津、上海、重庆、石家庄、保定、太原、晋城、呼和浩特、沈阳、大连、长春、哈尔滨、南京、无锡、苏州、杭州、宁波、温州、嘉兴、合肥、芜湖、福州、厦门、泉州、南昌、鹰潭、济南、青岛、郑州、南阳、武汉、长沙、株洲、广州、深圳、佛山、东莞、南宁、柳州、海口、琼海、成都、贵阳、昆明、西安、兰州、西宁、银川、乌鲁木齐'
# 移动5G商用城市名单
Mobile = '北京、天津、上海、重庆、石家庄、保定、太原、晋城、呼和浩特、沈阳、大连、长春、哈尔滨、南京、无锡、苏州、杭州、宁波、温州、嘉兴、合肥、芜湖、福州、厦门、泉州、南昌、鹰潭、济南、青岛、郑州、南阳、武汉、长沙、株洲、广州、深圳、佛山、东莞、柳州、南宁、海口、琼海、成都、贵阳、昆明、西安、兰州、西宁、银川、乌鲁木齐、'
# 移动5G商用城市名单
Unicom = '北京、上海、广州、深圳、杭州、南京、天津、武汉、济南、郑州、苏州、青岛、重庆、成都、宁波、温州、嘉兴、绍兴、东莞、佛山、中山、珠海、无锡、常州、南通、沈阳、长沙、大连、兰州、福州、石家庄、太原、西宁、西安、厦门、贵阳、保定、呼和浩特、南宁、海口、哈尔滨、南昌、合肥、银川、昆明、长春、泉州、柳州、鹰潭、乌鲁木齐、'


# 处理数据,拼接-分割
mStr = Mobile + Unicom + Telecom
mStr = mStr.split("、")


# 城市计数
citys = []
counts = Counter(mStr)
for i, j in zip(counts, counts.values()):
    citys.append((i, j))
print(citys)


# 生成地图
c = (
    Geo()
    .add_schema(maptype="china")
    .add("geo", citys, symbol_size=6)
    .set_series_opts(
        # 自定义标签(显示)
        label_opts=opts.LabelOpts(
            formatter=JsCode(
                """
                function(x){
                    console.log(x);
                    if (['福州', '乌鲁木齐', '呼和浩特', '银川', '西宁', '兰州', '成都', '贵阳', '昆明', '南宁', '海口', '长沙', '南昌', '武汉', '合肥', '郑州', '济南', '太原', '石家庄', '天津', '北京', '大连', '沈阳', '长春', '哈尔滨'].indexOf(x.data.name) > -1) {
                        return x.data.name
                    }
                    else {
                        return ''
                    }
                }
                """
            ),
            color='black'
        )
    )
    .set_global_opts(
        # 视觉映射配置,分段型
        visualmap_opts=opts.VisualMapOpts(is_show=True, is_piecewise=True, pieces=[{"value": 1, "color": '#F95DBA', "label": '1个运营商支持', "symbol": 'circle', "symbolSize": 6}, {"value": 2, "color": '#A64DFF', "label": '2个运营商支持', "symbol": 'circle', "symbolSize": 6}, {"value": 3, "color": '#4E70F0', "label": '3个运营商支持', "symbol": 'circle', "symbolSize": 6}], pos_left='22%', pos_bottom='7%'),
        # 图表标题及副标题
        title_opts=opts.TitleOpts(title="目前提供5G商用网络的城市", subtitle='数据来源:电信、移动、联通官方发布', pos_left='center', pos_top='-1%', item_gap=5),
        # 隐藏图例
        legend_opts=opts.LegendOpts(is_show=False),
        # 添加多个文本
        graphic_opts=[
            opts.GraphicGroup(
                graphic_item=opts.GraphicItem(left='68%', top='52%', z=99),
                children=[
                    opts.GraphicText(
                        graphic_item=opts.GraphicItem(left='68%', top='52%', z=100),
                        graphic_textstyle_opts=opts.GraphicTextStyleOpts(
                            text='江浙沪共10\n个城市拥有\n商用5G网络',
                            font='bolder 14px Microsoft YaHei',
                            graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(fill="black"))
                    )
                ],
            ),
            opts.GraphicGroup(
                graphic_item=opts.GraphicItem(left='68%', top='61%', z=99),
                children=[
                    opts.GraphicText(
                        graphic_item=opts.GraphicItem(left='68%', top='61%', z=100),
                        graphic_textstyle_opts=opts.GraphicTextStyleOpts(
                            text='上海 杭州 南京\n苏州 无锡 南通 常州\n宁波 温州 嘉兴 绍兴',
                            font='lighter 12px Microsoft YaHei',
                            graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(fill="black"))
                    )
                ],
            ),
            opts.GraphicGroup(
                graphic_item=opts.GraphicItem(left='58%', top='84%', z=99),
                children=[
                    opts.GraphicText(
                        graphic_item=opts.GraphicItem(left='58%', top='84%', z=100),
                        graphic_textstyle_opts=opts.GraphicTextStyleOpts(
                            text='广东5G商用城市\n最多(6个)',
                            font='bolder 14px Microsoft YaHei',
                            graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(fill="black"))
                    )
                ],
            ),
            opts.GraphicGroup(
                graphic_item=opts.GraphicItem(left='58%', top='90%', z=99),
                children=[
                    opts.GraphicText(
                        graphic_item=opts.GraphicItem(z=100),
                        graphic_textstyle_opts=opts.GraphicTextStyleOpts(
                            text='广州 深圳 佛山 东莞 中山 珠海',
                            font='lighter 12px Microsoft YaHei',
                            graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(fill="black"))
                    )
                ],
            ),
            opts.GraphicGroup(
                graphic_item=opts.GraphicItem(left='23%', top='63%', z=99),
                children=[
                    opts.GraphicText(
                        graphic_item=opts.GraphicItem(z=100),
                        graphic_textstyle_opts=opts.GraphicTextStyleOpts(
                            text='西藏是目前唯一没有\n商用网络的省份',
                            font='bolder 14px Microsoft YaHei',
                            graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(fill="black"))
                    )
                ]
            )
        ]
    )
    .render("目前提供5G商用网络的城市.html")
)

As you can see here, through the JsCode function , you can also directly add JS code.

The function of the JS code is to display only a part of the label information. After all, all 55 city names are displayed on the map, which is a bit messy.

The GraphicGroup function is the native graphic element component of Pyecharts, through which you can add text , pictures and other elements to the chart .

Here, small F adds 5 paragraphs of text, and defines the text position and style.

From the map, most of the 55 cities are located in provincial capitals, municipalities directly under the Central Government, the Yangtze River Delta and the Pearl River Delta.

It is expected that more and more cities will be able to provide 5G networks and reduce the price of 5G packages.


更多精彩推荐
☞本周六定位上海!解析百度文心(ERNIE)如何助力快速定制企业级NLP模型
☞头发越秃程序员就越厉害? | 每日趣闻
☞独家对话谢宝友:做一款类似于 Linux 的国产操作系统  | 人物志
☞DeepFashion实现服装检测搭配
☞蓝色巨人IBM全力奔赴的混合云之旅能顺利吗?
☞区块链赋能供应链金融|应用优势与四类常见模式
点分享点点赞点在看

Guess you like

Origin blog.csdn.net/csdnsevenn/article/details/109252066