<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:11.0pt;
        font-family:DengXian;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:DengXian;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">Dear Matplotlib team,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">I hope this letter finds you well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">I’m a new matplotlib so I’m not sure if it’s me doing wrong or there could be a bug replated to matplotlib itself. I’m currently running Python 3.10 with Matplotlib 3.5.1.
 This possible bug seems to be related to some incompatibility between the “extend” argument in “plt.figure.colorbar” and “.ax.invert_yaxis()” functions. More specifically, if I just extend the max of colorbar (first figure) or just invert the y-axis of the
 colorbar(second figure), everything work fine. However, if I do this two at the same time, the colorbar would be inverted while the extended arrow is not(figure three).
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><img width="422" height="319" style="width:4.4in;height:3.325in" id="_x56fe__x7247__x0020_2" src="cid:image002.png@01D82B54.CD991AC0"><img width="387" height="307" style="width:4.0333in;height:3.2in" id="_x56fe__x7247__x0020_3" src="cid:image003.png@01D82B54.CD991AC0"><img width="400" height="320" style="width:4.1666in;height:3.3333in" id="_x56fe__x7247__x0020_1" src="cid:image005.png@01D82B54.D51B8F30"></span><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">And I here enclosed the code which I use to create the plot:          
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"># Generate X/Y point mesh grid<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    x = np.linspace(-4.5, 1.5, 400) 
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    y = np.linspace(-8, -2, 400)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    X, Y = np.meshgrid(x, y)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    potential, rate_determining_step = calculate_limiting_potential_from_linear_relations(X, Y, free_energy_dict)[0], calculate_limiting_potential_from_linear_relations(X,
 Y, free_energy_dict)[1]   # calculate limiting potential for each point on the mesh grid<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    # Create backup ground volcano plot<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    fig = plt.figure(figsize=[8, 6])<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    background = fig.add_subplot(111)  # add sub plot<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    # Add contour plot<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:10.8pt"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">contour = background.contourf(X, Y, potential, levels=512, cmap="rainbow")  # create filled contour (reverse rainbow)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:10.8pt"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    # Create colorbar<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    cbar = fig.colorbar(contour, shrink=0.95, aspect=15, ticks=[1, 2, 3, 4])  # create colorbar (shrink/aspect for the size of the bar)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    cbar.set_label("Limiting Potential (eV)", fontsize=16)  # add label to the colorbar<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    cbar.ax.tick_params(labelsize=12)  # set tick label size<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">    cbar.ax.invert_yaxis()  # put the colorbar upside down<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">Sorry I can’t  send you the script and datasheet because it contents sensitive data. Thanks for your time and wishing you all the best.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Calibri",sans-serif">Haoyu<o:p></o:p></span></p>
</div>
</body>
</html>