提交 7755ac6b 编写于 作者: 逆流者blog's avatar 逆流者blog 🇨🇳

使用Pygal模拟掷骰子

上级 86429e02
/.idea/
/**/.idea/
/*/venv/
\ No newline at end of file
from random import randint
class Die:
"""表示一个骰子的类"""
def __init__(self, num_sides=6):
"""骰子默认为6面"""
self.num_sides = num_sides
def roll(self):
"""返回一个位于骰子面数的随机的值,默认1-6"""
return randint(1, self.num_sides)
import pygal
from die import Die
# 创建两个骰子
die1 = Die()
die2 = Die()
# 掷几次骰子,并将结果存储在一个列表中
results1 = []
results2 = []
for roll_num in range(1000):
result1 = die1.roll()
result2 = die2.roll()
results1.append(result1)
results2.append(result2)
# 分析结果
# 分析第一个骰子的结果
frequencies1 = []
for value in range(1, die1.num_sides + 1):
# count() 统计一个值在列表中出现的次数
frequency1 = results1.count(value)
frequencies1.append(frequency1)
# 分析第二个骰子的结果
frequencies2 = []
for value in range(1, die2.num_sides + 1):
# count() 统计一个值在列表中出现的次数
frequency2 = results2.count(value)
frequencies2.append(frequency2)
# 对结果进行可视化
hist = pygal.Bar()
hist.title = "两个骰子随机滚动1000次的结果"
hist.x_labels = ['1', '2', '3', '4', '5', '6']
hist.x_title = "结果"
hist.y_title = "结果频率"
# 将一系列值添加到图表中
hist.add('骰子1', frequencies1)
hist.add('骰子2', frequencies2)
hist.render_to_file('die_visual.svg')
<?xml version='1.0' encoding='utf-8'?>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" id="chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9" class="pygal-chart" viewBox="0 0 800 600"><!--Generated with pygal 2.4.0 (etree) ©Kozea 2012-2016 on 2020-10-22--><!--http://pygal.org--><!--http://github.com/Kozea/pygal--><defs><style type="text/css">#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9{-webkit-user-select:none;-webkit-font-smoothing:antialiased;font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .title{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:16px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .legends .legend text{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:14px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis text{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:10px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis text.major{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:10px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .text-overlay text.value{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:16px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .text-overlay text.label{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:10px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:14px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 text.no_data{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:64px}
#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9{background-color:rgba(249,249,249,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 path,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 rect,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 circle{-webkit-transition:150ms;-moz-transition:150ms;transition:150ms}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .graph &gt; .background{fill:rgba(249,249,249,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .plot &gt; .background{fill:rgba(255,255,255,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .graph{fill:rgba(0,0,0,.87)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 text.no_data{fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .title{fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .legends .legend text{fill:rgba(0,0,0,.87)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .legends .legend:hover text{fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .line{stroke:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .guide.line{stroke:rgba(0,0,0,.54)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .major.line{stroke:rgba(0,0,0,.87)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis text.major{fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y .guides:hover .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .line-graph .axis.x .guides:hover .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .stackedline-graph .axis.x .guides:hover .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .xy-graph .axis.x .guides:hover .guide.line{stroke:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .guides:hover text{fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .reactive{fill-opacity:.7;stroke-opacity:.8}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .ci{stroke:rgba(0,0,0,.87)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .reactive.active,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .active .reactive{fill-opacity:.8;stroke-opacity:.9;stroke-width:4}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .ci .reactive.active{stroke-width:1.5}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .series text{fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip rect{fill:rgba(255,255,255,1);stroke:rgba(0,0,0,1);-webkit-transition:opacity 150ms;-moz-transition:opacity 150ms;transition:opacity 150ms}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip .label{fill:rgba(0,0,0,.87)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip .label{fill:rgba(0,0,0,.87)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip .legend{font-size:.8em;fill:rgba(0,0,0,.54)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip .x_label{font-size:.6em;fill:rgba(0,0,0,1)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip .xlink{font-size:.5em;text-decoration:underline}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip .value{font-size:1.5em}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .bound{font-size:.5em}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .max-value{font-size:.75em;fill:rgba(0,0,0,.54)}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .map-element{fill:rgba(255,255,255,1);stroke:rgba(0,0,0,.54) !important}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .map-element .reactive{fill-opacity:inherit;stroke-opacity:inherit}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .color-0,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .color-0 a:visited{stroke:#F44336;fill:#F44336}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .color-1,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .color-1 a:visited{stroke:#3F51B5;fill:#3F51B5}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .text-overlay .color-0 text{fill:black}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .text-overlay .color-1 text{fill:black}
#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 text.no_data{text-anchor:middle}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .guide.line{fill:none}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .centered{text-anchor:middle}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .title{text-anchor:middle}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .legends .legend text{fill-opacity:1}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.x text{text-anchor:middle}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.x:not(.web) text[transform]{text-anchor:start}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.x:not(.web) text[transform].backwards{text-anchor:end}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y text{text-anchor:end}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y text[transform].backwards{text-anchor:start}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y2 text{text-anchor:start}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y2 text[transform].backwards{text-anchor:end}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .guide.line{stroke-dasharray:4,4}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .major.guide.line{stroke-dasharray:6,6}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .horizontal .axis.y .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .horizontal .axis.y2 .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .vertical .axis.x .guide.line{opacity:0}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .horizontal .axis.always_show .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .vertical .axis.always_show .guide.line{opacity:1 !important}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y .guides:hover .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.y2 .guides:hover .guide.line,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis.x .guides:hover .guide.line{opacity:1}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .axis .guides:hover text{opacity:1}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .nofill{fill:none}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .subtle-fill{fill-opacity:.2}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .dot{stroke-width:1px;fill-opacity:1}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .dot.active{stroke-width:5px}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .dot.negative{fill:transparent}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 text,#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 tspan{stroke:none !important}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .series text.active{opacity:1}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip rect{fill-opacity:.95;stroke-width:.5}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .tooltip text{fill-opacity:1}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .showable{visibility:hidden}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .showable.shown{visibility:visible}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .gauge-background{fill:rgba(229,229,229,1);stroke:none}#chart-96f29752-6f01-431e-8038-5fe3cf9f2cf9 .bg-lines{stroke:rgba(249,249,249,1);stroke-width:2px}</style><script type="text/javascript">window.pygal = window.pygal || {};window.pygal.config = window.pygal.config || {};window.pygal.config['96f29752-6f01-431e-8038-5fe3cf9f2cf9'] = {"allow_interruptions": false, "box_mode": "extremes", "classes": ["pygal-chart"], "css": ["file://style.css", "file://graph.css"], "defs": [], "disable_xml_declaration": false, "dots_size": 2.5, "dynamic_print_values": false, "explicit_size": false, "fill": false, "force_uri_protocol": "https", "formatter": null, "half_pie": false, "height": 600, "include_x_axis": false, "inner_radius": 0, "interpolate": null, "interpolation_parameters": {}, "interpolation_precision": 250, "inverse_y_axis": false, "js": ["//kozea.github.io/pygal.js/2.0.x/pygal-tooltips.min.js"], "legend_at_bottom": false, "legend_at_bottom_columns": null, "legend_box_size": 12, "logarithmic": false, "margin": 20, "margin_bottom": null, "margin_left": null, "margin_right": null, "margin_top": null, "max_scale": 16, "min_scale": 4, "missing_value_fill_truncation": "x", "no_data_text": "No data", "no_prefix": false, "order_min": null, "pretty_print": false, "print_labels": false, "print_values": false, "print_values_position": "center", "print_zeroes": true, "range": null, "rounded_bars": null, "secondary_range": null, "show_dots": true, "show_legend": true, "show_minor_x_labels": true, "show_minor_y_labels": true, "show_only_major_dots": false, "show_x_guides": false, "show_x_labels": true, "show_y_guides": true, "show_y_labels": true, "spacing": 10, "stack_from_top": false, "strict": false, "stroke": true, "stroke_style": null, "style": {"background": "rgba(249, 249, 249, 1)", "ci_colors": [], "colors": ["#F44336", "#3F51B5", "#009688", "#FFC107", "#FF5722", "#9C27B0", "#03A9F4", "#8BC34A", "#FF9800", "#E91E63", "#2196F3", "#4CAF50", "#FFEB3B", "#673AB7", "#00BCD4", "#CDDC39", "#9E9E9E", "#607D8B"], "font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "foreground": "rgba(0, 0, 0, .87)", "foreground_strong": "rgba(0, 0, 0, 1)", "foreground_subtle": "rgba(0, 0, 0, .54)", "guide_stroke_dasharray": "4,4", "label_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "label_font_size": 10, "legend_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "legend_font_size": 14, "major_guide_stroke_dasharray": "6,6", "major_label_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "major_label_font_size": 10, "no_data_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "no_data_font_size": 64, "opacity": ".7", "opacity_hover": ".8", "plot_background": "rgba(255, 255, 255, 1)", "stroke_opacity": ".8", "stroke_opacity_hover": ".9", "title_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "title_font_size": 16, "tooltip_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "tooltip_font_size": 14, "transition": "150ms", "value_background": "rgba(229, 229, 229, 1)", "value_colors": [], "value_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "value_font_size": 16, "value_label_font_family": "Consolas, \"Liberation Mono\", Menlo, Courier, monospace", "value_label_font_size": 10}, "title": "\u4e24\u4e2a\u9ab0\u5b50\u968f\u673a\u6eda\u52a81000\u6b21\u7684\u7ed3\u679c", "tooltip_border_radius": 0, "tooltip_fancy_mode": true, "truncate_label": null, "truncate_legend": null, "width": 800, "x_label_rotation": 0, "x_labels": ["1", "2", "3", "4", "5", "6"], "x_labels_major": null, "x_labels_major_count": null, "x_labels_major_every": null, "x_title": "\u7ed3\u679c", "xrange": null, "y_label_rotation": 0, "y_labels": null, "y_labels_major": null, "y_labels_major_count": null, "y_labels_major_every": null, "y_title": "\u7ed3\u679c\u9891\u7387", "zero": 0, "legends": ["\u9ab0\u5b501", "\u9ab0\u5b502"]}</script><script type="text/javascript" xlink:href="https://kozea.github.io/pygal.js/2.0.x/pygal-tooltips.min.js" /></defs><title>两个骰子随机滚动1000次的结果</title><g class="graph bar-graph vertical"><rect x="0" y="0" width="800" height="600" class="background" /><g transform="translate(121, 46)" class="plot"><rect x="0" y="0" width="658.8" height="488" class="background" /><g class="axis y always_show"><g class="guides"><path d="M0.000000 478.615385 h658.800000" class="axis major line" /><text x="-5" y="482.11538461538464" class="major">0</text><title>0</title></g><g class="guides"><path d="M0.000000 429.222672 h658.800000" class="guide line" /><text x="-5" y="432.7226720647773" class="">20</text><title>20</title></g><g class="guides"><path d="M0.000000 379.829960 h658.800000" class="guide line" /><text x="-5" y="383.32995951417007" class="">40</text><title>40</title></g><g class="guides"><path d="M0.000000 330.437247 h658.800000" class="guide line" /><text x="-5" y="333.93724696356276" class="">60</text><title>60</title></g><g class="guides"><path d="M0.000000 281.044534 h658.800000" class="guide line" /><text x="-5" y="284.5445344129555" class="">80</text><title>80</title></g><g class="guides"><path d="M0.000000 231.651822 h658.800000" class="major guide line" /><text x="-5" y="235.15182186234819" class="major">100</text><title>100</title></g><g class="guides"><path d="M0.000000 182.259109 h658.800000" class="guide line" /><text x="-5" y="185.75910931174093" class="">120</text><title>120</title></g><g class="guides"><path d="M0.000000 132.866397 h658.800000" class="guide line" /><text x="-5" y="136.36639676113361" class="">140</text><title>140</title></g><g class="guides"><path d="M0.000000 83.473684 h658.800000" class="guide line" /><text x="-5" y="86.9736842105263" class="">160</text><title>160</title></g><g class="guides"><path d="M0.000000 34.080972 h658.800000" class="guide line" /><text x="-5" y="37.580971659919044" class="">180</text><title>180</title></g></g><g class="axis x"><path d="M0.000000 0.000000 v488.000000" class="line" /><g class="guides"><path d="M65.457692 0.000000 v488.000000" class="guide line" /><text x="65.4576923076923" y="503.0" class="">1</text></g><g class="guides"><path d="M171.034615 0.000000 v488.000000" class="guide line" /><text x="171.0346153846154" y="503.0" class="">2</text></g><g class="guides"><path d="M276.611538 0.000000 v488.000000" class="guide line" /><text x="276.61153846153843" y="503.0" class="">3</text></g><g class="guides"><path d="M382.188462 0.000000 v488.000000" class="guide line" /><text x="382.1884615384615" y="503.0" class="">4</text></g><g class="guides"><path d="M487.765385 0.000000 v488.000000" class="guide line" /><text x="487.76538461538456" y="503.0" class="">5</text></g><g class="guides"><path d="M593.342308 0.000000 v488.000000" class="guide line" /><text x="593.3423076923076" y="503.0" class="">6</text></g></g><g class="series serie-0 color-0"><g class="bars"><g class="bar"><rect x="21.791076923076925" y="93.35222672064776" rx="0" ry="0" width="40.879384615384616" height="385.2631578947369" class="rect reactive tooltip-trigger" /><desc class="value">156</desc><desc class="x centered">42.23076923076923</desc><desc class="y centered">285.9838056680162</desc><desc class="x_label">1</desc></g><g class="bar"><rect x="127.368" y="105.70040485829958" rx="0" ry="0" width="40.879384615384616" height="372.91497975708506" class="rect reactive tooltip-trigger" /><desc class="value">151</desc><desc class="x centered">147.8076923076923</desc><desc class="y centered">292.1578947368421</desc><desc class="x_label">2</desc></g><g class="bar"><rect x="232.94492307692306" y="43.95951417004051" rx="0" ry="0" width="40.879384615384616" height="434.65587044534414" class="rect reactive tooltip-trigger" /><desc class="value">176</desc><desc class="x centered">253.38461538461536</desc><desc class="y centered">261.2874493927126</desc><desc class="x_label">3</desc></g><g class="bar"><rect x="338.5218461538461" y="24.20242914979758" rx="0" ry="0" width="40.879384615384616" height="454.41295546558706" class="rect reactive tooltip-trigger" /><desc class="value">184</desc><desc class="x centered">358.96153846153845</desc><desc class="y centered">251.4089068825911</desc><desc class="x_label">4</desc></g><g class="bar"><rect x="444.09876923076916" y="125.4574898785425" rx="0" ry="0" width="40.879384615384616" height="353.15789473684214" class="rect reactive tooltip-trigger" /><desc class="value">143</desc><desc class="x centered">464.5384615384615</desc><desc class="y centered">302.0364372469636</desc><desc class="x_label">5</desc></g><g class="bar"><rect x="549.6756923076923" y="9.384615384615415" rx="0" ry="0" width="40.879384615384616" height="469.2307692307692" class="rect reactive tooltip-trigger" /><desc class="value">190</desc><desc class="x centered">570.1153846153846</desc><desc class="y centered">244.00000000000003</desc><desc class="x_label">6</desc></g></g></g><g class="series serie-1 color-1"><g class="bars"><g class="bar"><rect x="68.24492307692309" y="48.89878542510121" rx="0" ry="0" width="40.879384615384616" height="429.71659919028343" class="rect reactive tooltip-trigger" /><desc class="value">174</desc><desc class="x centered">88.6846153846154</desc><desc class="y centered">263.7570850202429</desc><desc class="x_label">1</desc></g><g class="bar"><rect x="173.82184615384617" y="61.246963562753024" rx="0" ry="0" width="40.879384615384616" height="417.3684210526316" class="rect reactive tooltip-trigger" /><desc class="value">169</desc><desc class="x centered">194.26153846153846</desc><desc class="y centered">269.9311740890688</desc><desc class="x_label">2</desc></g><g class="bar"><rect x="279.3987692307692" y="51.36842105263156" rx="0" ry="0" width="40.879384615384616" height="427.2469635627531" class="rect reactive tooltip-trigger" /><desc class="value">173</desc><desc class="x centered">299.8384615384615</desc><desc class="y centered">264.9919028340081</desc><desc class="x_label">3</desc></g><g class="bar"><rect x="384.97569230769227" y="85.94331983805671" rx="0" ry="0" width="40.879384615384616" height="392.67206477732793" class="rect reactive tooltip-trigger" /><desc class="value">159</desc><desc class="x centered">405.4153846153846</desc><desc class="y centered">282.2793522267207</desc><desc class="x_label">4</desc></g><g class="bar"><rect x="490.5526153846153" y="98.29149797570852" rx="0" ry="0" width="40.879384615384616" height="380.3238866396761" class="rect reactive tooltip-trigger" /><desc class="value">154</desc><desc class="x centered">510.99230769230763</desc><desc class="y centered">288.45344129554655</desc><desc class="x_label">5</desc></g><g class="bar"><rect x="596.1295384615385" y="56.30769230769232" rx="0" ry="0" width="40.879384615384616" height="422.3076923076923" class="rect reactive tooltip-trigger" /><desc class="value">171</desc><desc class="x centered">616.5692307692308</desc><desc class="y centered">267.46153846153845</desc><desc class="x_label">6</desc></g></g></g></g><g class="titles"><text x="400.0" y="26" class="title plot_title">两个骰子随机滚动1000次的结果</text><text x="450.59999999999997" y="580" class="title">结果</text><text x="47.199999999999996" y="316.0" class="title" transform="rotate(-90 47.200000 290.000000)">结果频率</text></g><g transform="translate(121, 46)" class="plot overlay"><g class="series serie-0 color-0" /><g class="series serie-1 color-1" /></g><g transform="translate(121, 46)" class="plot text-overlay"><g class="series serie-0 color-0" /><g class="series serie-1 color-1" /></g><g transform="translate(121, 46)" class="plot tooltip-overlay"><g transform="translate(0 0)" style="opacity: 0" class="tooltip"><rect rx="0" ry="0" width="0" height="0" class="tooltip-box" /><g class="text" /></g></g><g transform="translate(10, 56)" class="legends"><g id="activate-serie-0" class="legend reactive activate-serie"><rect x="0.0" y="1.0" width="12" height="12" class="color-0 reactive" /><text x="17.0" y="11.2">骰子1</text></g><g id="activate-serie-1" class="legend reactive activate-serie"><rect x="0.0" y="22.0" width="12" height="12" class="color-1 reactive" /><text x="17.0" y="32.2">骰子2</text></g></g><g transform="translate(790, 56)" class="legends" /></g></svg>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册