<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on</title><link>https://zhanghb55.github.io/docs/python/</link><description>Recent content in Python on</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Tue, 06 Oct 2020 08:49:15 +0000</lastBuildDate><atom:link href="https://zhanghb55.github.io/docs/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Run</title><link>https://zhanghb55.github.io/docs/python/run/</link><pubDate>Wed, 06 Mar 2024 14:53:31 +0800</pubDate><guid>https://zhanghb55.github.io/docs/python/run/</guid><description>Run benchmark scripts
import subprocess import os import shlex import datetime import shutil import tempfile def exprange(low, hi, cnt=1): x = low step = 1. / cnt while x &amp;lt; hi: for i in range(cnt): yield int(x * (1 + step * i)) x *= 2 yield x def create_temporary_copy(path): temp_dir = tempfile.gettempdir() temp_path = os.path.join(temp_dir, os.path.basename(path) + str(hash(path))) shutil.copy2(path, temp_path) return temp_path iterations = 1 filename = st = datetime.</description></item><item><title>Plot</title><link>https://zhanghb55.github.io/docs/python/plot/</link><pubDate>Tue, 05 Mar 2024 18:02:25 +0800</pubDate><guid>https://zhanghb55.github.io/docs/python/plot/</guid><description>True Type Font # https://stackoverflow.com/questions/44314401/matplotlib-non-uniform-fonts-in-pdf-after-changing-from-type-3-font-to-type-1 plt.rcParams[&amp;#39;pdf.fonttype&amp;#39;] = 42 plt.rcParams[&amp;#39;ps.fonttype&amp;#39;] = 42 params = {&amp;#39;text.usetex&amp;#39;: False, &amp;#39;mathtext.fontset&amp;#39;: &amp;#39;stixsans&amp;#39;} plt.rcParams.update(params) Tick # Tick direction # ax.tick_params(axis=&amp;#39;y&amp;#39;, which=&amp;#39;both&amp;#39;, direction=&amp;#39;in&amp;#39;) ax.tick_params(axis=&amp;#39;x&amp;#39;, which=&amp;#39;both&amp;#39;, bottom=False, labelbottom=False) Tick label format # Scientific ax.ticklabel_format(axis=&amp;#39;x&amp;#39;, style=&amp;#39;sci&amp;#39;, scilimits=(7, 7)) ax.yaxis.get_major_formatter().set_powerlimits((0, 0)) Tick locator # Index locator ax.xaxis.set_major_locator(plt.IndexLocator(base=1e8, offset=1.3e8)) Log locator ax.yaxis.set_major_locator(plt.LogLocator(base=10.0, numticks=10, subs=[1])) ax.yaxis.set_minor_locator(plt.LogLocator(base=10.0, numticks=10, subs=[_ for _ in range(10)])) Legend # Combining lineplot and barplot label # line_handles, labels = axes[0].</description></item></channel></rss>