histogram

Vertical and Horizontal figures on one plot

Vertical and Horizontal figures on one plot Question: I would like to create sth like the following graph in matplotlib: I have x = [0, 1, …, 10], and for each x I have values from range [0, 60]. Lets say that the black line is the quantile of values for a given i from …

Total answers: 1

Trying to input counts that are float values into histogram with set bins

Trying to input counts that are float values into histogram with set bins Question: I have this set of data here that I am trying to create a histogram for: | cos_low | cos_up | E_low | E_up | diff_cross | |-1 |-0.9 |105 |162.9 |21.7861 | |-1 |-0.9 |162.9 |220.8 |41.0181 | |-1 |-0.9 …

Total answers: 1

Having trouble create a histogram with plt.hist, with year on the x-axis in python

Having trouble create a histogram with plt.hist, with year on the x-axis in python Question: Hi I have a data frame containing students and their graduation year. Column 1 is the student name, such as Peter, Henry… And column 2 is the student’s graduation year, such as 2023, 2024. I tried to build a histogram …

Total answers: 1

histogram: setting y-axis label for pandas

histogram: setting y-axis label for pandas Question: I have dataframe: d = {‘group’: [‘A’, ‘A’, ‘A’, ‘A’, ‘B’, ‘B’, ‘B’, ‘B’, ‘D’, ‘D’, ‘D’, ‘D’, ‘D’], ‘value’: [0.2, 0.4, 0.6, 0.8, 0.2, 0.4, 0.6, 0.8, 0.2, 0.4, 0.6, 0.8, 1.0], ‘count’: [4, 3, 7, 3, 12, 14, 5, 10, 3, 8, 7, 15, 4]} df …

Total answers: 1

plot histogram with pandas with a time column as object?

plot histogram with pandas with a time column as object? Question: I’m new in python. I would like to plot in a histogram the numbers of movements that made a group of insects in a determinated time. I have this dataframe: time movements 00:00 3147 00:01 1590 00:02 450 …… ….. …… ….. …… ….. …

Total answers: 1

tick labels on x-axis in matplotlib histogram

tick labels on x-axis in matplotlib histogram Question: I have created histogram successfully but the tick labels are very wide. I am want smaller tick labels like ‘1.5-1.75’ ‘1.75-2.0’. This is my code: binlist = [-10.0, -9.95, -9.9, -9.85, -9.8, -9.75, -9.7, -9.65, -9.6, -9.55, -9.5, -9.45, -9.4, -9.35, -9.3, -9.25, -9.2, -9.15, -9.1, -9.05, …

Total answers: 1

How to normalize histograms in joinplot margins

How to normalize histograms in joinplot margins Question: How can I normalize the histograms in sns.jointplot? Right now I’m getting this plot However, instead of showing 0, 200, 400 on the axis, I would like it to be a fraction of the total number of the dataset This is my code: import numpy as np …

Total answers: 2

How to show all occurrences in the hover data of a plotly.express histogram

How to show all occurrences in the hover data of a plotly.express histogram Question: I’m trying to construct a histogram in plotly that can show data from other columns in the histogram’s bins using the hover_data argument. As an example, take the following small dataset: import pandas as pd word_data = {‘author’:[‘Martin Luther King Jr.’, …

Total answers: 1

df.hist() is not returning plot of desired size

df.hist() is not returning plot of desired size Question: I am using df.hist() to get plots of all the columns in my DataFrame. The problem is that it is not displaying my plots in desired dimensions I am using following code: plt.figure(figsize=(10,12)) df.hist() plt.show() it returns me with a grid of histograms but with a …

Total answers: 1

Seaborn plot displot with hue and dual y-scale (twinx)

Seaborn plot displot with hue and dual y-scale (twinx) Question: I am trying to plot the output from the predict of a ML model, there are the classes 1,0 for the Target, and the Score. Due the dataset is not balanced, there are few 1’s. When I plot a simple displot with the Target in …

Total answers: 3