Plotting with logarithmic scaling for the 'x' axis?

i like this post (click again to cancel)
1
i dont like this post (click again to cancel)

Hey! Would appreciate very much a bit of help:

I have an Array of data of Positions Vs. Time intervals, where Time goes from 0 to 10000, and every slot on the array represents a time interval of 100. The question is - is there any way to plot the data in the array using List_plot...show(), but with a logarithmic scaled 'x' axis ? Meaning - labels running as - 10^(-4), 10^(-3), ..., 10^5?

Thank you!

asked Jun 24 '12

anonymous user

Anonymous

2 Answers:

i like this answer (click again to cancel)
5
i dont like this answer (click again to cancel)

There is a ticket for such a thing at http://ask.sagemath.org/question/675/how-do-i-create-a-log-plot-of-line-data. From the notes there, it is not quite ready.

You can see the answer to a similar question at log-log plots.

Matplotlib has a LogFormatter that you also might be able to use, but I haven't got it working at the moment. It does not appear that using the tick_formatter in show will let you call this LogFormatter, but I might be missing something here.

link

posted Jun 24 '12

calc314 gravatar image calc314
1855 3 19 53

updated Jun 24 '12

1

Actually, http://trac.sagemath.org/sage_trac/ticket/4529 has positive review! Hopefully it will still apply on Sage 5.1. You are right that you have to be a little carefully about the formatters - see the patches at that ticket for more info.

kcrisman (Jun 25 '12)
i like this answer (click again to cancel)
3
i dont like this answer (click again to cancel)

Since Sage 5.2 it's as simple as

list_plot(data_array, scale='semilogx') # Logarithmic scale for X-axis
list_plot(data_array, scale='semilogy') # Logarithmic scale for Y-axis
list_plot(data_array, scale='loglog') # Logarithmic scale for both axes
link

posted Aug 03 '12

v_2e gravatar image v_2e flag of Ukraine
219 1 11 24

updated Aug 04 '12

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

1 follower

Tags:

Stats:

Asked: Jun 24 '12

Seen: 216 times

Last updated: Aug 04 '12

Related questions

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.