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 :: python OSError: [Errno 22] Invalid argument: 
Python :: np where and 
Python :: densenet python keras 
Python :: depth first search 
Python :: is the multiply code in python 
Python :: python package install 
Python :: python pytest vs unittest 
Python :: python print array 
Python :: @property python 
Python :: python error 
Python :: bayesian model probability 
Python :: self object 
Python :: python lenght 
Python :: string template python 
Python :: unittest 
Python :: try and exception 
Python :: get element by index in list python 
Python :: sys python 
Python :: pivot tables pandas explicación 
Python :: zipfile python unzip with path 
Python :: python assertEqual tuple list 
Python :: how to change the starting number for the loop count in pythin 
Python :: what will be the output of the following python code? i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0) 
Python :: include" is not definedP 
Python :: how write a date with th and nd in python 
Python :: password validation in python 
Python :: python code to encrypt and decrypt a stringn with password 
Python :: django compile database 
Python :: &quot;Token&quot; is not defined Pylance 
Python :: cython could not creat pyd file no such file or directory 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =