Questions tagged [histplot]

30 questions
0
votes
1 answer

Convert overlapping bin ticks to scientific notation in seaborn histplot x-axis

I have a dataframe of 100 rows of floats ranging from 0.000001 to 0.001986 that I wish to plot on a seaborn histplot, separated by class. I started with, sns.histplot(data=df, x='score', hue='test_result', kde=True, color='red', …
Alice
  • 588
  • 1
  • 8
  • 25
0
votes
1 answer

Why don't the multiple stacked histplot bars match the legend?

# my 'new_ba', 'route', and 'sentiment' are defined plt.figure(figsize = (10,5)) plt.title('Sentiment of Route') colors = {'Positive': 'green', 'Neutral': 'blue', 'Negative': 'red'} sns.histplot(data=new_ba, x='route', hue='sentiment',…
EG Film
  • 9
  • 1
0
votes
1 answer

Duplicated labels in the legend of Seaborn histplot

I am trying to generate a combined histplot with two datasets together with the following codes _,bins = np.histogram([150, 600], bins=30) alpha = 0.4 fig, ax = plt.subplots(1,1) sns.histplot(df1['Tm/K Pred.'], bins=bins, alpha=alpha,…
zzrrhhh
  • 11
  • 2
0
votes
1 answer

Remove Bins from Marginal histplot in Jointplot

I am trying to remove the superposed line of the bins (derived from the hisplot part of the jointplot function) in the lateral plot here in this figure (in white): column1 = "F" array1 = np.random.randn(400) column2 = "R" array2 =…
ChYoung
  • 3
  • 3
0
votes
0 answers

There is a way to calculate and plot means and standard deviation of multi-column python dataframe?

I have three pandas dataframes with more columns: import pandas as pd import numpy as np from matplotlib import pyplot as plt from scipy import stats import seaborn as sns data = np.random.randint(0, 1001, size=(1000, 100)) data[data < 0] = 0 df1 =…
Giantanque
  • 45
  • 4
0
votes
1 answer

Set bar with lower value to foreground in histplot

When creating a histogram plot with seaborn, I would like to dynamically put the bar with the lower count to the front. Below is a minimal example where now the blue bar is always in the front, no matter its count. For example, in the second bin, I…
timbmg
  • 3,192
  • 7
  • 34
  • 52
0
votes
1 answer

histplot is showing data grouped in pairs

I'm trying to create a histoplot to show a certain column of my dataframe that I'm sure has values for every single integer going from 47 to 93 but when I plot it it leaves spaces every two values. I'm not sure if this is intended behavior and in…
0
votes
0 answers

Plot color is darker than specified color in histplot

I'm trying to visualize if a group of people live in their birthplace or not in different years (pandas df). But the histplot colors are much darker than what I have specified as if there is a dark filter on the plot itself. The colors in the legend…
samnord
  • 1
  • 1
0
votes
1 answer

How to show minimum and maximum values of a column as x ticks at the center of the bins

I would like to display x-axis value on the center of each bin. Besides, minimum and maximum value of the column here flipper_length_mm should be shown first and lastly, respecively. Below you can find my attempt. import matplotlib.pyplot as…
0
votes
1 answer

size of figure in sns.histplot

I was trying to fix the size of figure when comparing one variable to other. columns = ['Education_Level' ] bins = [30, 6] for i, columns in enumerate(columns): #plt.figure(figsize=(15,8)) fig = sns.FacetGrid(BankChurners,…
Riddle2795
  • 49
  • 6
0
votes
1 answer

Set colors to hue categories

I'm trying to use sns.histplot() with 'hue' but the colors of the legend and the bars does not match. I would like to change the colors of the bars(blue, dark blue) to another, maybe the same as the legend. How can I do that? Here what I tried and…
0
votes
1 answer

seaborn multiple histplot color palette

The following example code: import seaborn as sns planets = sns.load_dataset("planets") sns.histplot( planets, x="year", y="distance", bins=30, discrete=(True, False), log_scale=(False, True), ) produces this plot How can I change the…
nbecker
  • 1,645
  • 5
  • 17
  • 23
0
votes
1 answer

Seaborn jointplot color histogram

I'd like to color my histogram according to my palette. Here's the code I used to make this, and here's the error I received when I tried an answer I found on here. g = sns.jointplot(data=emb_df, x='f0', y='y', kind="hist", hue='klabels',…
Bigboss01
  • 438
  • 6
  • 21
0
votes
2 answers

Difference between KDE and Histogram Frequency

The result what i observed from sns density plot is quite confusing. the result for : sns.distplot(subset['difference_ratio'], kde = True, label =label ,hist=False).set(xlim=(0,1)) is below: And the result for…
Anil Kumar
  • 385
  • 2
  • 17
-1
votes
0 answers

Legend not displayed in histplot

I am trying to create a Seaborn Histogram Plot showing the frequency of Time In Shelter per Outcome Type. The legend is meant to show the Outcome Type per colour on the Histogram but it's not being displayed. I am getting an error message saying "No…
Querty
  • 1
  • 1
1
2