0

I have the following code:

firsts = pd.date_range(start='1/1/2020', periods=12, freq='M') 
n_days =  list(firsts.days_in_month)  
n_days = [0] + n_days[:-1]
ticks = np.cumsum(n_days)  
ticks_dates = full_dates[ticks]
ticklabels = [date.strftime('%m-%d') for date in ticks_dates]
ax.set_xticks(ticks)
ax.set_xticklabels(ticklabels, rotation=45)

After the last line when the chart is plotted, this is also shown:

[Text(0, 0, '01-01'),
 Text(0, 0, '02-01'),
 Text(0, 0, '03-01'),
 Text(0, 0, '04-01'),
 Text(0, 0, '05-01'),
 Text(0, 0, '06-01'),
 Text(0, 0, '07-01'),
 Text(0, 0, '08-01'),
 Text(0, 0, '09-01'),
 Text(0, 0, '10-01'),
 Text(0, 0, '11-01'),
 Text(0, 0, '12-01')]

Is there anyway i can hide this? and have the chart only?

1 Answer 1

2

Put a semicolon ; after the last line to suppress the output

ax.set_xticklabels(ticklabels, rotation=45);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.