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 log scale y axis base

ax.set_yscale("log", base=2).
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 :: clearing all text from a file in python 
Python :: tkiner border 
Python :: install pipenv on windows 
Python :: python convert number to string with leading zeros 
Python :: label encoder python 
Python :: add text to plot python 
Python :: python auto module installer 
Python :: find different values from two lists python 
Python :: pandas replace nonetype with empty string 
Python :: pandas save without index 
Python :: numpy compare arrays 
Python :: count number of islands python 
Python :: python distance between coordinates 
Python :: install re package python 
Python :: python convert png to jpg 
Python :: month from datetime pandas 
Python :: python perfect square 
Python :: clibboard to png 
Python :: pandas to csv without header 
Python :: python confidence interval 
Python :: selenium-screenshot python 
Python :: tkinter how to disable window resizing 
Python :: python sqrt import 
Python :: record video with python 
Python :: sklearn minmaxscaler pandas 
Python :: pytorch tensor change dimension order 
Python :: get role from name discord.py 
Python :: n random numbers python 
Python :: f-string ponto decimal python 
Python :: rename column name pandas dataframe 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =