matplotlib

Previous topic

pylab_examples example code: subplots_demo.py

Next topic

pylab_examples example code: system_monitor.py

This Page

pylab_examples example code: symlog_demo.pyΒΆ

(Source code, png)

../../_images/symlog_demo.png
#!/usr/bin/env python
from pylab import *

dt = 0.01
x = arange(-50.0, 50.0, dt)
y = arange(0, 100.0, dt)

subplot(311)
plot(x, y)
xscale('symlog')
ylabel('symlogx')
grid(True)
gca().xaxis.grid(True, which='minor')  # minor grid on too

subplot(312)
plot(y, x)
yscale('symlog')
ylabel('symlogy')


subplot(313)
plot(x, np.sin(x / 3.0))
xscale('symlog')
yscale('symlog', linthreshy=0.015)
grid(True)
ylabel('symlog both')

show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)