the way to make jupyter output cell has a dark background in vscode

Posted yusisc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了the way to make jupyter output cell has a dark background in vscode相关的知识,希望对你有一定的参考价值。

the issue to be fixed

As shown in the picture, jupyter output cell has a bright background, even it\'s ask to use dark background.

the way to go

import matplotlib.pyplot as plt
import numpy as np
from IPython.display import HTML

#############################    matplot setting up    ############################
%matplotlib widget
plt.style.use(\'dark_background\')
HTML(\'\'\'
<style>
    .jupyter-matplotlib background-color: #003030;
    .widget-label, .jupyter-matplotlib-headercolor: #b0b0b0;
    .jupyter-button background-color: #333;color: #b0b0b0;
    .cell-output-ipywidget-background background-color: transparent !important;
    .cell-output-ipywidget-background pre color: white !important;
</style>
\'\'\')

fig = plt.figure("fig0")
plt.clf()
plt.plot(np.arange(11))
plt.show()

reference

python - VS Code Jupyter notebook dark theme for interactive elements - Stack Overflow
https://stackoverflow.com/questions/75429196/vs-code-jupyter-notebook-dark-theme-for-interactive-elements

Add support for theming of IPyWidgets · Issue #7161 · microsoft/vscode-jupyter
https://github.com/microsoft/vscode-jupyter/issues/7161

learn python the hard way_make a game

关于中文输出:

Windows上面Python 2.x程序涉及到中文字符时建议:

  • Python源码文件保存的时候保存为UTF-8无BOM编码格式

  • 在Python源码文件第一行或者第二行加上

     
    # -*- coding:utf8 -*- 
  • 所有代码中出现中文字符串的地方用Unicdoe对象,用u‘‘包起来

以上是关于the way to make jupyter output cell has a dark background in vscode的主要内容,如果未能解决你的问题,请参考以下文章

题解CodeForces 910A The Way to Home

learn python the hard way_make a game

5 Ways to Make Your Hive Queries Run Faster

A. The Way to Home

The way to unwind the stack on Linux EABI

The best way to learn a programming language