The seaborn styles shipped by Matplotlib are deprecated since 3.6

2024/10/7 14:25:48

The seaborn styles shipped by Matplotlib are deprecated since 3.6, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-<style>'. Alternatively, directly use the seaborn API instead.

I have tried this:

# use seaborn style
plt.style.use("seaborn")

but it is deprecated, and I want to remove this warning when I use the cmd in windows

Answer

This warning is telling you that seaborn styles in matplotlib do not match current seaborn styles, since the latest have been updated.

This is why you should set the style as follow:

plt.style.use("seaborn-v0_8")

You can specify a theme by replacing <style> with one the following:

  • bright
  • colorblind
  • dark
  • dark-palette
  • darkgrid
  • deep
  • muted
  • notebook
  • paper
  • pastel
  • poster
  • talk
  • ticks
  • white
  • whitegrid

Just like this:

plt.style.use("seaborn-v0_8-whitegrid")

Alternatively, if you want to use the latest seaborn styles, use their library directly.

Edit: adding missing themes for completeness.

https://en.xdnf.cn/q/70229.html

Related Q&A

Python: Can the pydoc module output HTML docs with relative paths?

I am using the pydoc module to output documentation for some types which I have defined with the C API. The types I want to document dont exist until the interpreter has been embedded inside my C progr…

How to generate coverage report for http based integration tests?

I am writing integration tests for a project in which I am making HTTP calls and testing whether they were successful or not.Since I am not importing any module and not calling functions directly cover…

Does Webdriver support pagefactory for Python?

I was reading about page objects and design patterns on the Webdriver project site and came across pagefactory. It doesnt look like the Webdriver for Python API includes pagefactory. Is this true?

Truncated versus floored division in Python

To establish context, Im talking about integer arithmetic only, on large integers so going via floating point isnt an option, and using negative numbers so the difference between floored and truncated …

when restoring from a checkpoint, how can I change the data type of the parameters?

I have a pre-trained Tensorflow checkpoint, where the parameters are all of float32 data type.How can I load checkpoint parameters as float16? Or is there a way to modify data types of a checkpoint?F…

Opencv Python open dng format

I cant figure out how to open a dng file in opencv. The file was created when using the pro options of the Samsung Galaxy S7. The images that are created when using those options are a dng file as well…

VSCode: Set environment variables via script

I have a shell script env.sh containing statements like export ENV_VAR1 = 1. On Linux terminal, I can use . env.sh or source env.sh to set the environment variables. How to set the environment variable…

TensorFlow performance bottleneck on IteratorGetNext

While fiddling around with TensorFlow, I noticed that a relatively simple task (batching some of our 3D accelerometer data and taking the sum of each epoch) was having relatively poor performance. Here…

SQLAlchemy - How to access column names from ResultProxy and write to CSV headers

I am trying to use SQLAlchemy to establish a connection to a PostgreSQL Database, execute a SQL query and print the output of the file to a file in linux. from sqlalchemy import create_engine import ya…

Python Facebook API - cursor pagination

My question involves learning how to retrieve my entire list of friends using Facebooks Python API. The current result returns an object with limited number of friends and a link to the next page. How …