Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to add percentages to ylabel python

import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.randn(100,5))

# you get ax from here
ax = df.plot()
type(ax)  # matplotlib.axes._subplots.AxesSubplot

# manipulate
vals = ax.get_yticks()
ax.set_yticklabels(['{:,.2%}'.format(x) for x in vals])
Comment

PREVIOUS NEXT
Code Example
Python :: how to print 2d neatly in python 
Python :: traduce query model 
Python :: AGE CALCULATOION IN PYTHON 
Python :: john cabot 
Python :: multiclasshead 
Python :: pandas Timedelta to postgres 
Python :: fb account api grabber 
Python :: how to use group by in python to get 15 mins candle data from 1 min candle 
Python :: scikit learn split data set site:stackoverflow.com 
Python :: python openstreetmap multiple latitude 
Python :: from wireframe GUI design to python tkinter 
Python :: bolumden kalan python 
Shell :: chrome remote debug 
Shell :: restart apache ubuntu 
Shell :: conda install gensim 
Shell :: list npm packages installed globally 
Shell :: nginx restart 
Shell :: git set email for project 
Shell :: linux find files larger than 1gb 
Shell :: install netstat ubuntu 
Shell :: install redis on mac 
Shell :: kde connect not showing devices 
Shell :: git undo commit 
Shell :: pip install flask_restful 
Shell :: stop tomcat from terminal mac 
Shell :: how to install pipenv on mac 
Shell :: bash shebang 
Shell :: snap install atom 
Shell :: magento 2 file permission 
Shell :: wifi password from command prompt 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =