I have data that I need to apply log-based transformations to followed
by plotting. Ideally I would like the plot to display the nicely
formatted log-scale major/minor ticks as when setting xscale('log').
Of course, doing that applies the default log transformation to
already log-transformed data.
I played around with the matplotlib.ticker classes, but the LogLocator
only seems to work properly when applied to a plot with axes set to
log scale or plotted with something like semilog (as in
import matplotlib.pyplot as plt
import matplotlib.ticker as mt
import numpy as np
x = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600,
700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000,
xlog = np.log10(x) #or some other more complex transform
y = [1 for i in x]
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(xlog,y, '.', c='blue', ms=2)
I'm probably missing something simple, but I haven't been able to
figure it out as of yet.
Thanks in advance for any suggestions/help.