Formatting X axis labels Pandas time series plot

puneet

I am trying to plot a multiple time series dataframe in pandas. The time series is a 1 year daily points of length 365. The figure is coming alright but I want to suppress the year tick showing on the x axis.enter image description here

I want to suppress the 1950 label showing in the left corner of x axis. Can anybody suggest something on this? My code

dates = pandas.date_range('1950-01-01', '1950-12-31', freq='D')

data_to_plot12 = pandas.DataFrame(data=data_array,    # values
             index=homo_regions)    # 1st column as index


dataframe1 = pandas.DataFrame.transpose(data_to_plot12)
dataframe1.index = dates

ax = dataframe1.plot(lw=1.5, marker='.', markersize=2, title='PRECT time series PI Slb Ocn CNTRL 60 years')

ax.set(xlabel="Months", ylabel="PRECT (mm/day)")

fig_name = 'dataframe1.pdf'

plt.savefig(fig_name) 
daryl

You should be able to specify the xaxis major formatter like so

import matplotlib.dates as mdates
...
ax.xaxis.set_major_formatter(mdates.DateFormatter('%b'))

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Plot with labels on the x axis

From Dev

Plot with labels on the x axis

From Dev

pyqtgraph : how to plot time series (date and time on the x axis)?

From Dev

Set x-axis labels to dates when plotting time series

From Dev

Multiple x-axis labels for time-series data

From Dev

Monthly time series plot with years on x-axis in R

From Dev

Changing X-axis values in Time Series plot with R

From Dev

Changing Axis on Time Series Plot

From Dev

Time-series x-axis dates from datetimeindex pandas

From Dev

Time-series x-axis dates from datetimeindex pandas

From Dev

How to add a y-axis label while using pandas.DataFrame.plot() for constructing a time series plot

From Dev

bar plot with time on x axis

From Dev

plot in the x-axis a rotate labels in R

From Dev

Missing x axis labels in R plot

From Dev

core plot x axis labels vertical

From Dev

Time Series plot with "times" in y-axis

From Dev

plot time series with discontinuous axis in R

From Dev

Format x-axis tick labels to seams like the default pandas plot

From Dev

Plot with one line for each column and time-series on the x-axis R

From Dev

How can I plot a time series that shows only days on x-axis?

From Dev

How can I plot a time series that shows only days on x-axis?

From Dev

time series plot with x axis ticks in month-year format in R

From Dev

change part of time x axis labels in ggplot

From Dev

Formatting datetime for plotting time-series with pandas

From Dev

R plot labels formatting

From Dev

Annotate X-axis labels in Pandas

From Dev

Normalize x-axis of time series

From Dev

Dates on x-axis, time series

From Dev

Dates on x-axis, time series

Related Related

HotTag

Archive