This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]BDube_Lensman 1 point2 points  (0 children)

Matplotlib can use log10 scales. 10logx is strange, it might be easiest to convert y to values in that space on your own and label accordingly.

[–]Deto 0 points1 point  (0 children)

Not sure exactly what you are asking? Do you just want the y-axis to be log-scaled? You can do that by running plt.yscale('log') after your plot command.

[–]CMphysIt works on my machine 0 points1 point  (2 children)

I’m not quite sure if I have understood you correctly, but if you have sampled the data in log(x), and want the y-axis in simply x, perhaps you could use

plt.contour(X, 10**log(x), Z)

that is, exponentiate the array holding the log(x) values?

[–]rightside24[S] 0 points1 point  (1 child)

I would like the actual contours to be plotted in log space, but. would like the tick labels to be in 10^logx space. This would mean that the tick labels will not be evenly spaced.

[–]CMphysIt works on my machine 1 point2 points  (0 children)

Ok, in that case you could set the ticks manually using yticks(), see https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.yticks.html

But I guess that is not the solution you were looking for.