Search code examples
pythonmatplotlibaxes

plot python figure with ticks only and not axes lines


I want to plot a figure in python and have only ticks, I do not want to see the axes lines, only the ticks.

How can I do it?

matplotlib.version = 1.3.0


Solution

  • you can use

    fig, ax =  subplots()
    ax.set_frame_on(False)
    

    to get an intro to ticks, spines etc. check this entry in the gallery:http://matplotlib.org/examples/ticks_and_spines/spines_demo_bounds.html

    There's a lot of functionality to change the position and appearance of these elements. For a lot more on making nice plots check http://blog.olgabotvinnik.com/post/58941062205/prettyplotlib-painlessly-create-beautiful-matplotlib