How can I make line chart with uneven time intervals? in FacetGrid function

  facet-grid, line-plot, python, seaborn

I made a line chart with seaborn FacetGrid, x-axis is the column called "dato", it is indicating the date of taking samples.

I have unequal time intervals between every sample taking, thereby I want to have corresponding space between every tick on x axis. how can I do that?

and I have a problem with making the correct order for dates also, tried some code, but not working for FacetGrid.

Here is my code and graph I made

mer=sns.FacetGrid(df, col='anlegg',hue='Merd',sharey=False,ylim=(0,4000))
sns.set_style('white')
sns.set_context('paper', font_scale=1.2)
mer.map_dataframe(sns.lineplot,x='dato',y='BW',marker='o',err_style='bars')
mer.add_legend()
mer.set_axis_labels('','BW')
mer.set_titles(col_template='anlegg {col_name}')
mer.set_xticklabels(rotation=90) ```
 


  [1]: https://i.stack.imgur.com/OwsyM.png

Source: Python Questions

LEAVE A COMMENT