ishandutta2007
ishandutta2007

Reputation: 18284

How to set yscale to log of log?

In pyplot there is an option to set yscale like this

ax.set_yscale('log')

but is there any work around to plot on 2nd degree log on y axis maybe something like this

ax.set_yscale('loglog')

PS: To clear confusion, the question is not how to transform and plot which is obviously trivial. The question is to plot keeping labels unaffected as it is with ax.set_yscale('log')

Upvotes: 0

Views: 1026

Answers (1)

Sheldore
Sheldore

Reputation: 39072

Here is a small working code for you with the double log

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(10)
y = 10**np.arange(1, 11)
plt.plot(x,np.log10(np.log10(y)), '-kx')
plt.yticks(np.log10(np.log10(y)), y)
plt.show()

enter image description here

Upvotes: 1

Related Questions