Skip to content

Instantly share code, notes, and snippets.

@jupihes
Last active September 17, 2022 19:01
Show Gist options
  • Save jupihes/b475a0fd3efb91e063b81fffecb32209 to your computer and use it in GitHub Desktop.
Save jupihes/b475a0fd3efb91e063b81fffecb32209 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

case for 4

fig = plt.figure()
ax = fig.add_subplot(111)
def func_plot():
    alpha1 = 0.25 # np.random.randint(0, 10) / 10
    rect1 = patches.Rectangle((-0.50, -0.50), 1, 1, color='g', alpha = alpha1)
    #rect2 = patches.Rectangle((0, -0.50), 0.5, 1, color='red', alpha = 0.25)
    for a, b in zip([1, 1, 3, 3],[1, 3, 1, 3]):
        circle_ = patches.Circle((a/4-0.5, b/4-.5), radius= 2**0.5/4, 
                                 color='g', alpha = alpha1 * .8)
        ax.add_patch(circle_)
    #circle2 = patches.Circle((+0.5, 0), radius= 2**0.5/2, color='green', alpha = 0.5)
    ax.add_patch(rect1)
#ax.add_patch(rect2)
#fig = plt.figure()
# ax = fig.add_subplot(111)
func_plot()
#ax.add_patch(circle2)
plt.xlim([-1, 1])
plt.ylim([-1, 1])
plt.axis('equal')
plt.grid()
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Created with matplotlib (https://matplotlib.org/) -->
<svg height="357.238125pt" version="1.1" viewBox="0 0 554.245312 357.238125" width="554.245312pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<metadata>
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2022-09-17T23:11:01.575323</dc:date>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
<dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
<defs>
<style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
</defs>
<g id="figure_1">
<g id="patch_1">
<path d="M 0 357.238125
L 554.245312 357.238125
L 554.245312 0
L 0 0
z
" style="fill:#ffffff;"/>
</g>
<g id="axes_1">
<g id="patch_2">
<path d="M 44.845313 333.36
L 547.045313 333.36
L 547.045313 7.2
L 44.845313 7.2
z
" style="fill:#ffffff;"/>
</g>
<g id="patch_3">
<path clip-path="url(#p23feeb1af6)" d="M 295.945312 170.28
C 315.604095 170.28 334.460351 162.469483 348.36121 148.568624
C 362.262068 134.667766 370.072585 115.81151 370.072585 96.152727
C 370.072585 76.493945 362.262068 57.637688 348.36121 43.73683
C 334.460351 29.835972 315.604095 22.025455 295.945312 22.025455
C 276.28653 22.025455 257.430274 29.835972 243.529415 43.73683
C 229.628557 57.637688 221.81804 76.493945 221.81804 96.152727
C 221.81804 115.81151 229.628557 134.667766 243.529415 148.568624
C 257.430274 162.469483 276.28653 170.28 295.945312 170.28
z
" style="fill:#bf00bf;opacity:0.4;stroke:#bf00bf;stroke-linejoin:miter;"/>
</g>
<g id="patch_4">
<path clip-path="url(#p23feeb1af6)" d="M 221.81804 244.407273
C 241.476822 244.407273 260.333079 236.596756 274.233937 222.695897
C 288.134795 208.795039 295.945312 189.938783 295.945312 170.28
C 295.945312 150.621217 288.134795 131.764961 274.233937 117.864103
C 260.333079 103.963244 241.476822 96.152727 221.81804 96.152727
C 202.159257 96.152727 183.303001 103.963244 169.402143 117.864103
C 155.501284 131.764961 147.690767 150.621217 147.690767 170.28
C 147.690767 189.938783 155.501284 208.795039 169.402143 222.695897
C 183.303001 236.596756 202.159257 244.407273 221.81804 244.407273
z
" style="fill:#bf00bf;opacity:0.4;stroke:#bf00bf;stroke-linejoin:miter;"/>
</g>
<g id="patch_5">
<path clip-path="url(#p23feeb1af6)" d="M 295.945312 244.407273
C 315.604095 244.407273 334.460351 236.596756 348.36121 222.695897
C 362.262068 208.795039 370.072585 189.938783 370.072585 170.28
C 370.072585 150.621217 362.262068 131.764961 348.36121 117.864103
C 334.460351 103.963244 315.604095 96.152727 295.945312 96.152727
C 276.28653 96.152727 257.430274 103.963244 243.529415 117.864103
C 229.628557 131.764961 221.81804 150.621217 221.81804 170.28
C 221.81804 189.938783 229.628557 208.795039 243.529415 222.695897
C 257.430274 236.596756 276.28653 244.407273 295.945312 244.407273
z
" style="fill:#bf00bf;opacity:0.4;stroke:#bf00bf;stroke-linejoin:miter;"/>
</g>
<g id="patch_6">
<path clip-path="url(#p23feeb1af6)" d="M 370.072585 244.407273
C 389.731368 244.407273 408.587624 236.596756 422.488482 222.695897
C 436.389341 208.795039 444.199858 189.938783 444.199858 170.28
C 444.199858 150.621217 436.389341 131.764961 422.488482 117.864103
C 408.587624 103.963244 389.731368 96.152727 370.072585 96.152727
C 350.413803 96.152727 331.557546 103.963244 317.656688 117.864103
C 303.75583 131.764961 295.945312 150.621217 295.945312 170.28
C 295.945312 189.938783 303.75583 208.795039 317.656688 222.695897
C 331.557546 236.596756 350.413803 244.407273 370.072585 244.407273
z
" style="fill:#bf00bf;opacity:0.4;stroke:#bf00bf;stroke-linejoin:miter;"/>
</g>
<g id="patch_7">
<path clip-path="url(#p23feeb1af6)" d="M 295.945312 318.534545
C 315.604095 318.534545 334.460351 310.724028 348.36121 296.82317
C 362.262068 282.922312 370.072585 264.066055 370.072585 244.407273
C 370.072585 224.74849 362.262068 205.892234 348.36121 191.991376
C 334.460351 178.090517 315.604095 170.28 295.945312 170.28
C 276.28653 170.28 257.430274 178.090517 243.529415 191.991376
C 229.628557 205.892234 221.81804 224.74849 221.81804 244.407273
C 221.81804 264.066055 229.628557 282.922312 243.529415 296.82317
C 257.430274 310.724028 276.28653 318.534545 295.945312 318.534545
z
" style="fill:#bf00bf;opacity:0.4;stroke:#bf00bf;stroke-linejoin:miter;"/>
</g>
<g id="patch_8">
<path clip-path="url(#p23feeb1af6)" d="M 221.81804 244.407273
L 370.072585 244.407273
L 370.072585 96.152727
L 221.81804 96.152727
z
" style="fill:#008000;opacity:0.1;stroke:#008000;stroke-linejoin:miter;"/>
</g>
<g id="matplotlib.axis_1">
<g id="xtick_1">
<g id="line2d_1">
<path clip-path="url(#p23feeb1af6)" d="M 73.563494 333.36
L 73.563494 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_2">
<defs>
<path d="M 0 0
L 0 3.5
" id="m995d9f7aba" style="stroke:#000000;stroke-width:0.8;"/>
</defs>
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="73.563494" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_1">
<!-- −1.5 -->
<g transform="translate(61.422088 347.958438)scale(0.1 -0.1)">
<defs>
<path d="M 10.59375 35.5
L 73.1875 35.5
L 73.1875 27.203125
L 10.59375 27.203125
z
" id="DejaVuSans-8722"/>
<path d="M 12.40625 8.296875
L 28.515625 8.296875
L 28.515625 63.921875
L 10.984375 60.40625
L 10.984375 69.390625
L 28.421875 72.90625
L 38.28125 72.90625
L 38.28125 8.296875
L 54.390625 8.296875
L 54.390625 0
L 12.40625 0
z
" id="DejaVuSans-49"/>
<path d="M 10.6875 12.40625
L 21 12.40625
L 21 0
L 10.6875 0
z
" id="DejaVuSans-46"/>
<path d="M 10.796875 72.90625
L 49.515625 72.90625
L 49.515625 64.59375
L 19.828125 64.59375
L 19.828125 46.734375
Q 21.96875 47.46875 24.109375 47.828125
Q 26.265625 48.1875 28.421875 48.1875
Q 40.625 48.1875 47.75 41.5
Q 54.890625 34.8125 54.890625 23.390625
Q 54.890625 11.625 47.5625 5.09375
Q 40.234375 -1.421875 26.90625 -1.421875
Q 22.3125 -1.421875 17.546875 -0.640625
Q 12.796875 0.140625 7.71875 1.703125
L 7.71875 11.625
Q 12.109375 9.234375 16.796875 8.0625
Q 21.484375 6.890625 26.703125 6.890625
Q 35.15625 6.890625 40.078125 11.328125
Q 45.015625 15.765625 45.015625 23.390625
Q 45.015625 31 40.078125 35.4375
Q 35.15625 39.890625 26.703125 39.890625
Q 22.75 39.890625 18.8125 39.015625
Q 14.890625 38.140625 10.796875 36.28125
z
" id="DejaVuSans-53"/>
</defs>
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-49"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="xtick_2">
<g id="line2d_3">
<path clip-path="url(#p23feeb1af6)" d="M 147.690767 333.36
L 147.690767 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_4">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="147.690767" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_2">
<!-- −1.0 -->
<g transform="translate(135.549361 347.958438)scale(0.1 -0.1)">
<defs>
<path d="M 31.78125 66.40625
Q 24.171875 66.40625 20.328125 58.90625
Q 16.5 51.421875 16.5 36.375
Q 16.5 21.390625 20.328125 13.890625
Q 24.171875 6.390625 31.78125 6.390625
Q 39.453125 6.390625 43.28125 13.890625
Q 47.125 21.390625 47.125 36.375
Q 47.125 51.421875 43.28125 58.90625
Q 39.453125 66.40625 31.78125 66.40625
z
M 31.78125 74.21875
Q 44.046875 74.21875 50.515625 64.515625
Q 56.984375 54.828125 56.984375 36.375
Q 56.984375 17.96875 50.515625 8.265625
Q 44.046875 -1.421875 31.78125 -1.421875
Q 19.53125 -1.421875 13.0625 8.265625
Q 6.59375 17.96875 6.59375 36.375
Q 6.59375 54.828125 13.0625 64.515625
Q 19.53125 74.21875 31.78125 74.21875
z
" id="DejaVuSans-48"/>
</defs>
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-49"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="xtick_3">
<g id="line2d_5">
<path clip-path="url(#p23feeb1af6)" d="M 221.81804 333.36
L 221.81804 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_6">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="221.81804" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_3">
<!-- −0.5 -->
<g transform="translate(209.676634 347.958438)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-48"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="xtick_4">
<g id="line2d_7">
<path clip-path="url(#p23feeb1af6)" d="M 295.945312 333.36
L 295.945312 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_8">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="295.945312" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_4">
<!-- 0.0 -->
<g transform="translate(287.99375 347.958438)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="xtick_5">
<g id="line2d_9">
<path clip-path="url(#p23feeb1af6)" d="M 370.072585 333.36
L 370.072585 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_10">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="370.072585" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_5">
<!-- 0.5 -->
<g transform="translate(362.121023 347.958438)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="xtick_6">
<g id="line2d_11">
<path clip-path="url(#p23feeb1af6)" d="M 444.199858 333.36
L 444.199858 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_12">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="444.199858" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_6">
<!-- 1.0 -->
<g transform="translate(436.248295 347.958438)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-49"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="xtick_7">
<g id="line2d_13">
<path clip-path="url(#p23feeb1af6)" d="M 518.327131 333.36
L 518.327131 7.2
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_14">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="518.327131" xlink:href="#m995d9f7aba" y="333.36"/>
</g>
</g>
<g id="text_7">
<!-- 1.5 -->
<g transform="translate(510.375568 347.958438)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-49"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
</g>
<g id="matplotlib.axis_2">
<g id="ytick_1">
<g id="line2d_15">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 318.534545
L 547.045313 318.534545
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_16">
<defs>
<path d="M 0 0
L -3.5 0
" id="mc32bb1b9ec" style="stroke:#000000;stroke-width:0.8;"/>
</defs>
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="318.534545"/>
</g>
</g>
<g id="text_8">
<!-- −1.00 -->
<g transform="translate(7.2 322.333764)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-49"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-48"/>
<use x="242.822266" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_2">
<g id="line2d_17">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 281.470909
L 547.045313 281.470909
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_18">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="281.470909"/>
</g>
</g>
<g id="text_9">
<!-- −0.75 -->
<g transform="translate(7.2 285.270128)scale(0.1 -0.1)">
<defs>
<path d="M 8.203125 72.90625
L 55.078125 72.90625
L 55.078125 68.703125
L 28.609375 0
L 18.3125 0
L 43.21875 64.59375
L 8.203125 64.59375
z
" id="DejaVuSans-55"/>
</defs>
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-48"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-55"/>
<use x="242.822266" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="ytick_3">
<g id="line2d_19">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 244.407273
L 547.045313 244.407273
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_20">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="244.407273"/>
</g>
</g>
<g id="text_10">
<!-- −0.50 -->
<g transform="translate(7.2 248.206491)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-48"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-53"/>
<use x="242.822266" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_4">
<g id="line2d_21">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 207.343636
L 547.045313 207.343636
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_22">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="207.343636"/>
</g>
</g>
<g id="text_11">
<!-- −0.25 -->
<g transform="translate(7.2 211.142855)scale(0.1 -0.1)">
<defs>
<path d="M 19.1875 8.296875
L 53.609375 8.296875
L 53.609375 0
L 7.328125 0
L 7.328125 8.296875
Q 12.9375 14.109375 22.625 23.890625
Q 32.328125 33.6875 34.8125 36.53125
Q 39.546875 41.84375 41.421875 45.53125
Q 43.3125 49.21875 43.3125 52.78125
Q 43.3125 58.59375 39.234375 62.25
Q 35.15625 65.921875 28.609375 65.921875
Q 23.96875 65.921875 18.8125 64.3125
Q 13.671875 62.703125 7.8125 59.421875
L 7.8125 69.390625
Q 13.765625 71.78125 18.9375 73
Q 24.125 74.21875 28.421875 74.21875
Q 39.75 74.21875 46.484375 68.546875
Q 53.21875 62.890625 53.21875 53.421875
Q 53.21875 48.921875 51.53125 44.890625
Q 49.859375 40.875 45.40625 35.40625
Q 44.1875 33.984375 37.640625 27.21875
Q 31.109375 20.453125 19.1875 8.296875
z
" id="DejaVuSans-50"/>
</defs>
<use xlink:href="#DejaVuSans-8722"/>
<use x="83.789062" xlink:href="#DejaVuSans-48"/>
<use x="147.412109" xlink:href="#DejaVuSans-46"/>
<use x="179.199219" xlink:href="#DejaVuSans-50"/>
<use x="242.822266" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="ytick_5">
<g id="line2d_23">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 170.28
L 547.045313 170.28
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_24">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="170.28"/>
</g>
</g>
<g id="text_12">
<!-- 0.00 -->
<g transform="translate(15.579688 174.079219)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/>
<use x="159.033203" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_6">
<g id="line2d_25">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 133.216364
L 547.045313 133.216364
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_26">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="133.216364"/>
</g>
</g>
<g id="text_13">
<!-- 0.25 -->
<g transform="translate(15.579688 137.015582)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-50"/>
<use x="159.033203" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="ytick_7">
<g id="line2d_27">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 96.152727
L 547.045313 96.152727
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_28">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="96.152727"/>
</g>
</g>
<g id="text_14">
<!-- 0.50 -->
<g transform="translate(15.579688 99.951946)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-53"/>
<use x="159.033203" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
<g id="ytick_8">
<g id="line2d_29">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 59.089091
L 547.045313 59.089091
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_30">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="59.089091"/>
</g>
</g>
<g id="text_15">
<!-- 0.75 -->
<g transform="translate(15.579688 62.88831)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-55"/>
<use x="159.033203" xlink:href="#DejaVuSans-53"/>
</g>
</g>
</g>
<g id="ytick_9">
<g id="line2d_31">
<path clip-path="url(#p23feeb1af6)" d="M 44.845313 22.025455
L 547.045313 22.025455
" style="fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;"/>
</g>
<g id="line2d_32">
<g>
<use style="stroke:#000000;stroke-width:0.8;" x="44.845313" xlink:href="#mc32bb1b9ec" y="22.025455"/>
</g>
</g>
<g id="text_16">
<!-- 1.00 -->
<g transform="translate(15.579688 25.824673)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-49"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/>
<use x="159.033203" xlink:href="#DejaVuSans-48"/>
</g>
</g>
</g>
</g>
<g id="patch_9">
<path d="M 44.845313 333.36
L 44.845313 7.2
" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/>
</g>
<g id="patch_10">
<path d="M 547.045313 333.36
L 547.045313 7.2
" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/>
</g>
<g id="patch_11">
<path d="M 44.845312 333.36
L 547.045313 333.36
" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/>
</g>
<g id="patch_12">
<path d="M 44.845312 7.2
L 547.045313 7.2
" style="fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;"/>
</g>
</g>
</g>
<defs>
<clipPath id="p23feeb1af6">
<rect height="326.16" width="502.2" x="44.845313" y="7.2"/>
</clipPath>
</defs>
</svg>

Riddle_classic of can-you-cover-the-baking-sheet-with-cookies

import matplotlib
from matplotlib import pyplot as plt, patches

fig = plt.figure()
ax = fig.add_subplot()
def func_plot():
    alpha1 = 0.5 # np.random.randint(0, 10) / 10
    rect1 = patches.Rectangle((-0.50, -0.50), 1, 1, color='g', alpha = alpha1/5)
    #rect2 = patches.Rectangle((0, -0.50), 0.5, 1, color='red', alpha = 0.25)
    for a, b in zip([0, -.5, 0, .5, 0],[0.5, 0, 0, 0, -.5]):
        circle_ = patches.Circle((a, b), radius= 0.5, 
                                 color='m', alpha = alpha1 * .8)
        ax.add_patch(circle_)
    
    ax.add_patch(rect1)

ax = fig.add_subplot(111)
func_plot()
plt.xlim([-1, 1])
plt.ylim([-1, 1])
plt.axis('equal')
plt.grid()
@jupihes
Copy link
Author

jupihes commented Sep 17, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment