Comments (7)
You can use a style sheet, but it looks like styles don't affect plot titles, so those have to be set manually:
%matplotlib ipympl
import matplotlib.pyplot as plt
plt.style.use(['dark_background'])
plt.plot([0,1,12])
plt.suptitle('figure title', color='w')
from ipympl.
-
We can use following for changing background:-
plt.patch.set_facecolor('lightgrey')
But this will work only for single plot. Not for grid plot, or more than one. -
We can use following for getting graphs like we get in jupyter lab light theme:-
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot') or plt.style.use('ggplot')
We need to specify "style.use('ggplot')" again in any next cell and not in the cell where we first set the style. Yes, we need to set it 2 times. Second should be the lighter theme.
style.available or plt.style.available
['Solarize_Light2',
'grayscale',
'ggplot',
'seaborn-dark-palette',
'seaborn-poster',
'tableau-colorblind10',
'seaborn-ticks',
'seaborn-muted',
'seaborn-bright',
'_classic_test',
'seaborn-darkgrid',
'seaborn-paper',
'seaborn',
'seaborn-colorblind',
'classic',
'seaborn-talk',
'seaborn-notebook',
'seaborn-dark',
'fivethirtyeight',
'fast',
'bmh',
'seaborn-pastel',
'seaborn-deep',
'seaborn-white',
'seaborn-whitegrid'
'dark_background']
lighter ones are:
{0: 'Solarize_Light2', 1: 'grayscale', 2: 'ggplot', 6: 'seaborn-ticks', 9: '_classic_test', 10: 'seaborn-darkgrid', 12: 'seaborn', 14: 'classic', 17: 'seaborn-dark', 18: 'fivethirtyeight', 23: 'seaborn-white', 24: 'seaborn-whitegrid'}
darker ones are:
{3: 'seaborn-dark-palette', 4: 'seaborn-poster', 5: 'tableau-colorblind10', 7: 'seaborn-muted', 8: 'seaborn-bright', 11: 'seaborn-paper', 13: 'seaborn-colorblind', 15: 'seaborn-talk', 16: 'seaborn-notebook', 19: 'fast', 20: 'bmh', 21: 'seaborn-pastel', 22: 'seaborn-deep', 25: 'dark_background'}
from ipympl.
Its no more a problem now...perhaps today onwards.
Just update your concerned python libraries(specially jupyterlab):-
pip install --upgrade numpy pandas matplotlib seaborn jupyterlab
from ipympl.
Yeah the problem isn't the style sheet, it is our rendered title:
from ipympl.
I found one solution for expanding the plot canvas a bit so that x and y ticks will get visible.
You need to add one line plt.style.use('default')
after importing the matplot lib module in notebook.
See my ticks are outside the canvas before.
After adding the line the tick got added to the canvas itself no further modification was needed.
As you can see in the above image this will pull the x and y ticks in the canvas to make it visible without changing or modifying ticks or plot color, it will make it easier to collaborate your work with others.
from ipympl.
Actually, we still have a problem with the figure title:
from ipympl.
Closing since the jlab theme cannot set the matplotlib style.
However, in master, the toolbar now uses the JupyterLab CSS variables.
from ipympl.
Related Issues (20)
- Latest version of everything still causes the dreaded Error displaying widget: model not found HOT 11
- An error in use of inset_axes of mpl_toolkits in Jupyter Notebook HOT 2
- [email protected]
- Comptability with mpl cursors
- Failed to load model class 'MPLCanvasModel' from module 'jupyter-matplotlib' Error: No version of module jupyter-matplotlib is registered. HOT 6
- Please remove jupyterlab==3.* requirement so as to allow 4.x to work. HOT 3
- Ability to configure defaults for `Canvas`
- Interactive graph - Saving
- Error: No version of module jupyter-matplotlib is registered HOT 5
- [test-bot] Scheduled Tests are failing
- Matplotlib Fails to Update Axis Limits with ipywidgets in Jupyter Lab HOT 1
- Question: how to use ipympl to simply include axes in ipywidets layout? HOT 1
- Large top/bottom padding for imshow images HOT 5
- Blank figures in Jupyter notebook HOT 13
- Cannot install with pip HOT 2
- %matplotlib widget run time error HOT 5
- Installing ipympl without matplotlib ? HOT 1
- MATLAB-like Vertical/Horizontal Zoom for strictly Vertical/Horizontal Drag HOT 1
- Click handler is broken with matplotlib>=3.5 HOT 1
- Conda Installation Safety Error - Size does not match reported size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipympl.