Oren
Oren

Reputation: 5319

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

Upvotes: 0

Views: 76

Answers (2)

Dan
Dan

Reputation: 638

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

Upvotes: 2

MaxNoe
MaxNoe

Reputation: 15007

you could try to set the color of the axis to your backgroundcolor. Assuming white:

for child in ax.get_children():
    if isinstance(child, matplotlib.spines.Spine):
        child.set_color('#FFFFFF')

Upvotes: 0

Related Questions