Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install python drawing module plotnine

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains how to install the python drawing module plotnine. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to install the python drawing module plotnine.

Installation

Use pip to install directly according to the official website tutorial

Pip install plotnine

Encounter an error report

ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Search and find that you can add a parameter to the pip command-- ignore-installed certifi.

So use the command to install

Pip install-I https://pypi.tuna.tsinghua.edu.cn/simple plotnine-- ignore-installed certifi

The installation was successful and no error was reported.

Try to import this module in python

From plotnine import *

Prompt

Bad key animation.mencoder_path in file C:\ Users\ mingy\ AppData\ Local\ Continuum\ anaconda3\ lib\ site-packages\ matplotlib\ mpl-data\ stylelib\ _ classic_test.mplstyle, line 509 ('animation.mencoder_path: mencoder')

You probably need to get an updated matplotlibrc file from

Https://github.com/matplotlib/matplotlib/blob/v3.3.1/matplotlibrc.template

Or from the matplotlib source distribution

After searching, I found that someone said that you can uninstall the already installed matplotlib and then reinstall it and try to uninstall it using the pip command.

Pip uninstall matplotlib

Reinstall command

Python-m pip install-U matplotlib-- prefer-binary-I https://pypi.tuna.tsinghua.edu.cn/simple

Matplotlib upgraded to 3.3.1 without encountered error opening python and then importing plotnine module

From plotnine import *

There's no hint this time.

Next, try to run one of the examples.

From plotnine import *

From plotnine.data import mtcars

Ggplot (mtcars,aes (x colors wtters) + geom_point ()

Image.pngggplot (mtcars,aes (x colors wtters)) + geom_point () + facet_wrap ('~ gear',scales= "free")

Image.png

Save as pdf file

(ggplot (mtcars,aes (gear) + geom_point () + facet_wrap ('~ gear',scales= "free"). Save ("Desktop/p1.pdf") so far, I believe you have a deeper understanding of "how to install the python drawing module plotnine". You might as well do it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report