2022.01.05 补充:matplotlib默认绘图字体
找到配置文件matplotlibrc
(Windows环境可以用Everything工具查找),修改里面font.family
值:
支持具体的字体名称(例如笔者修改为论文绘图常用的Times New Roman
字体,或是以下5种字体类型:
2022.08.01补充
在qtconsole环境里面使用sympy默认是用latex形式渲染成png,直接复制到word会失真,可以通过以下命令使用svg渲染sympy结果:
from sympy import *
from sympy.abc import *
init_printing(use_latex='svg',forecolor='Black')
2022.05.11补充
设置qtconsole绘图格式为svg
(1)生成~/.ipython/profile_default/ipython_kernel_config.py
文件:ipython profile create
(2)在ipython_kernel_config.py添加下列命令:c.InlineBackend.figure_format = 'svg'
2019.09.24补充
修改qtconsole显示主题,修改文件jupyter_qtconsole_config.py
第275行代码::

效果如下:

2018.12.21补充
1、笔者使用的的winpython集成环境,其自带有qtconsole和相应的配置文件存放目录,按照下面的方法生成文件jupyter_qtconsole_config.py
之后将其复制到目录C:\Applications\WPy-3661\settings\.jupyter
下才能生效,同样,启动代码将其复制到C:\Applications\WPy-3661\settings\.ipython
2、退出qtconsole时去除确定退出提醒,修改文件jupyter_qtconsole_config.py
第47行代码:
## Set to display confirmation dialog on exit. You can always use 'exit' or
# 'quit', to force a direct exit without any confirmation.
c.JupyterConsoleApp.confirm_exit = False
## Connect to an already running kernel
#c.JupyterConsoleApp.existing = ''
## The name of the default kernel to start.
------
1、设置qtconsole字体类型及大小
(1) 首先生成jupyter qtconsoel的配置文件,在Linux或者win下的终端执行下面命令
jupyter qtconsole --generate-config
以win为例,会在当前用户目录下生成"C:\Users\admin\.jupyter\jupyter_qtconsole_config.py"
,如下图,在Linux下是在目录~/.jupyter/
(2)修改配置文件jupyter_qtconsole_config.py
2、设置ipython启动脚本
(1)进到目录C:\Users\admin\.ipython\profile_default\startup
,里面有个README文档,就是说在这个目录下面添加.py或者.ipy文件ipython会首先执行里面的代码
(2)添加需要初始化的代码块,编写文件
startfirst.py
里面可以添加自己想要事先执行的程序
在Linux系统下同样在目录~/.ipython/profile_default/startup
下面