3

I've done some searching around, and cannot easily find a solution this problem. Effectively, I want to have multiple tick locators on a single axis such that I can do something like in the plot below.

CMB Power Spectrum

Note how the x-axis starts off logarithmic, but becomes linear once 500 is reached. I figured one possible solution was to simply divide the data into two portions, plot it on two graphs, each with their own locators, and then put the graphs right next to each other so they're seamless, but that seems very unpythonic. Anyone have a better solution?

zephyr
  • 2,182
  • 3
  • 29
  • 51
  • [This might be of help](http://stackoverflow.com/questions/21746491/combining-a-log-and-linear-scale-in-matplotlib) – Srivatsan Apr 04 '15 at 21:27

2 Answers2

0

I suspect the following URL might be of use:

http://matplotlib.org/examples/axes_grid/parasite_simple2.html (click on the plot to have the python code)

If you need some specialized graphs, it's always a good idea to have a look at the Matplotlib gallery:

http://matplotlib.org/gallery.html

EDIT: It is possible to make custom ticks on the X-axis:

http://matplotlib.org/examples/ticks_and_spines/ticklabels_demo_rotation.html

jcoppens
  • 5,306
  • 6
  • 27
  • 47
  • That doesn't really address my question. It seems that shows how to put two different axes on a plot. I'm looking for two different scales on a spine, i.e., one that starts of logarithmic and changes to linear. – zephyr Apr 04 '15 at 19:58
  • My apologies - I misunderstood the question. I've edited the reply. It's still not entirely elegant, but at least easier than glueing two plots together. – jcoppens Apr 04 '15 at 21:02
0

You may find an implementation of this scale by Jesús Torrado here.

joaoFaria
  • 123
  • 1
  • 4