Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib y axis log scale

import pylab
import matplotlib.pyplot as plt
a = [pow(10, i) for i in range(10)]
fig = plt.figure()
ax = fig.add_subplot(2, 1, 1)

line, = ax.plot(a, color='blue', lw=2)

ax.set_yscale('log')

pylab.show()
Comment

matplotlib logarithmic scale

fig, axs = plt.subplots()
#on x asix
ax.set_xscale('log')
#on y asix
ax.set_yscale('log')
Comment

matplotlib matshow log scale

from pylab import figure, cm
from matplotlib.colors import LogNorm

# C = some matrix
f = figure(figsize=(6.2, 5.6))
ax = f.add_axes([0.17, 0.02, 0.72, 0.79])
axcolor = f.add_axes([0.90, 0.02, 0.03, 0.79])

im = ax.matshow(C, cmap=cm.gray_r, norm=LogNorm(vmin=0.01, vmax=1))

t = [0.01, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0]
f.colorbar(im, cax=axcolor, ticks=t, format="$%.2f$")

f.show()
Comment

PREVIOUS NEXT
Code Example
Python :: how to delete row pandas in for loop 
Python :: what skills do you need to master pvp in minecraft 
Python :: python rotate screen 
Python :: Extract images from html page based on src attribute using beatutiful soup 
Python :: convert python list to text file 
Python :: for every file in the folder do python 
Python :: plt to png python 
Python :: get list of folders in directory python 
Python :: python reload function from file 
Python :: Python project root dir 
Python :: python except keyboardinterrupt 
Python :: min max scaler sklearn 
Python :: terminal python version 
Python :: python strip non numeric in string 
Python :: python link shortener 
Python :: check if special character in string python 
Python :: make string numeric pandas 
Python :: networkx remove nodes with degree 
Python :: get_object_or_404 
Python :: python pandas dataframe column date to string 
Python :: pandas convert all column names to lowercase 
Python :: how to save python list to file 
Python :: how to search for a specific file extension with python 
Python :: password generator python 
Python :: import xgboost 
Python :: get current file name python 
Python :: python sort dictionary alphabetically by key 
Python :: python half of string 
Python :: python cv2 screen capture 
Python :: combination python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =