Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the dots from a figure produced using plot_date?

I am trying to create a figure with a solid line, using plot_date.

from matplotlib.pyplot import show, plot_date
plot_date(time_info, np.arange(3), linestyle='-')
show()
print time_info

The print out is

[datetime.datetime(2018, 8, 13, 16, 41, 2), 
 datetime.datetime(2018, 8, 13, 16, 41, 7), 
 datetime.datetime(2018, 8, 13, 16, 41, 13)]

and the produced figure is:

enter image description here

How to remove the dots?

like image 352
Gideon Kogan Avatar asked Oct 16 '22 14:10

Gideon Kogan


1 Answers

You can add marker='' or marker='None'

plot_date(time_info, np.arange(3), linestyle='-', marker='')

Or markersize=0:

plot_date(time_info, np.arange(3), linestyle='-', markersize=0)

One more option suggested by @Bazingaa:

plot_date(time_info, np.arange(3), '-') # or '-b'
like image 92
Joe Avatar answered Oct 22 '22 16:10

Joe