Skip to content
Advertisement

Tag: seaborn

How to format the y- or x-axis labels in a seaborn FacetGrid

I want to format y-axis labels in a seaborn FacetGrid plot, with a number of decimals, and/or with some text added. Inspired from How to format seaborn/matplotlib axis tick labels from number to thousands or Millions? (125,436 to 125.4K) It results in the following error. AttributeError: ‘FacetGrid’ object has no attribute ‘xaxis’ Answer xaxis and yaxis are attributes of the

How to specify the color for a partial histogram patch

I would like to produce the following graph Note that one bar is partially blue and partially teal. This is what I’m trying to reproduce Rectangle(xy=(0.876747, 0), width=0.408487, height=0.206371, angle=0) is the Rectangle that needs to be partially colored. Rectangle(xy=(1.28523, 0), width=0.408487, height=0.150066, angle=0) is the patch immediately after, which is colored Teal Plot generated by my code Note the

How to *Rotate* labels in a Seaborn PairGrid?

The columns in my dataframe has long names, so when I make a pairplot, the labels overlaps one another. I would like to rotate my labels 90 degrees, so they don’t collide. I tried looking up online and documentation, but could not find a solution. Here is something I wrote & the error message: How can I rotate labels (both

Connecting means in seaborn box plot

I want to connect box plot means. I can do the basic part but cannot connect box plot means and box plots offset from x axis. similar post but not connecting means Python: seaborn pointplot and boxplot in one plot but shifted on the x-axis As we can see the sns.line plot does not follow the means and box plots

Seaborn histogram makes columns white

In what cases Seaborn makes histogram columns white? I use it Seaborn in Jupyter notebook: Then I plot histogram using this function: As a result in some cases I have histograms with all blue columns or some blue and some white or only white columns. Please, see attached pictures. How to make Seaborn always draw blue columns? Answer I believe

Seaborn expands X axis dates back to year 2000

I have a pandas dataframe that contains dates starting at 2017-09-01 (which I believe is in the correct format for a dataframe date). But the X axis is expanded dramatically. I do not have any outliers on the LHS. Answer Pandas and matplotlib’s dates sometimes don’t go along well. You can set the xlims explicitly as follows:

Time Series Plot Seaborn with MultiIndex

I have the following dataset: The dataset spans three months and counts the occurrence of five codes per day. In order to plot the data I have just used the following code: I am wondering though, how this can be done using seaborn and a lineplot ? Answer Is this what you are looking for?

Advertisement