我已经为我的x刻度标签创建了小数值,但这些分数看起来有点局促。有没有办法增加垂直间距?
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.set_xlim(0, 10)
ax.set_xticklabels(
['$\\frac{
}{<?php
$response = file_get_contents('https://sisa.msal.gov.ar/sisa/services/rest/puco/44003375');
$response = new SimpleXMLElement($response);
dd($response);
?>
}$'.format('M', x) for x in ax.get_xticks()],
fontsize=12)
plt.show()
答案 0 :(得分:1)
使用\dfrac
可能会有所帮助。但是,我们需要修改序言。
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{amsmath}')
fig, ax = plt.subplots()
ax.set_xlim(0, 10)
ax.set_xticklabels(
['$\\dfrac{
}{//same values
var deviceMessageList1 = _deviceMessageRepository.Fromdevicemessages
.Where(m => m.DeviceId == deviceId).Take(1000).ToList();
//different values
var deviceMessageList2 = _deviceMessageRepository.Fromdevicemessages
.Where(m => m.DeviceId == deviceId).Take(1000).Select(x=> new { Message = x.Message }).ToList();
}$'.format('M', x) for x in ax.get_xticks()],
fontsize=12)
此处提供更多信息:How to write your own LaTeX preamble in Matplotlib?
答案 1 :(得分:0)