Skip to main content

All Questions

0 votes
1 answer
450 views

Overlapping density plots of multiple pandas data frame columns

import numpy as np import pandas as pd col1 = np.random.normal(0, 1, (1000, )) col2 = np.random.normal(0, 1, (1000, )) col3 = np.random.normal(0, 1, (1000, )) df = pd.DataFrame({'col1':col1, 'col2':...
Jesse Downing's user avatar
2 votes
1 answer
266 views

How to plot multiple features with the same tag number in histogram plot

I have a text file including 8 features and 1 class. The data of my file is (data.txt): 1,1,3,2,1,1,1,3,HIGH 1,1,3,1,2,1,1,3,HIGH 1,1,1,1,3,3,1,2,HIGH 1,3,2,1,3,3,3,3,HIGH 1,3,1,2,3,1,2,1,HIGH 2,3,1,...
Leo's user avatar
  • 509
4 votes
1 answer
2k views

Plot a histogram with constant bar widths but different bin sizes

I have a Python script which produces a single histogram of three data sets, where the bin sizes are provided as a list. The Python script sippet is as follows: bin_l=np.arange(0,14,1) bin_l=np....
RogUE's user avatar
  • 363
2 votes
2 answers
12k views

Problem plotting a histogram of grayscale image in python

I have plotted a histogram of a grayscale image with matplotlib. But the histogram does not look like what I want. from matplotlib import pyplot as plt import numpy as np from PIL import Image im=...
MKS's user avatar
  • 199
0 votes
0 answers
42 views

Histogram with counts of string variables in matplotlib [duplicate]

I want to plot a histogram with matploblib in Python, but my code doesn't seem to work. I imported data from a textfile with the following code: vragenlijst_data= np.genfromtxt('antwoorden.txt', ...
ItK's user avatar
  • 73
2 votes
1 answer
1k views

Column order reversed in step histogram plot

Passing a 2D array to Matplotlib's histogram function with histtype='step' seems to plot the columns in reverse order (at least from my biased, Western perspective of left-to-right). Here's an ...
Munier Salem's user avatar
0 votes
1 answer
64 views

How to create a historgram in matplotlib with values instead of data

Supposed I have the data set [1,1,1,2,2] and want the bins [1,2),[2,3) then I can use the follwoing code to generate a histogram: import matplotlib.pyplot as plt data = [1,1,1,2,2] values = [1,2,3] ...
Micah Pearce's user avatar
  • 1,965
0 votes
1 answer
1k views

TypeError when plotting histogram with Matplotlib

I'm trying to plot a histogram of a file of float numbers. The contents of the file look like this: 0.1066770707640915 0.0355590235880305 0.0711180471760610 0.4267082830563660 0.0355590235880305 0....
Antimony's user avatar
  • 2,240
0 votes
1 answer
469 views

Meaning of colors in histogram matplotlib

l have a numpy variable called rnn1 of dimension(37,512) n, bins, patches = plt.hist(rnn1, histtype='stepfilled') l got the following histogram shape To what the different colors refer ? What is the ...
helene's user avatar
  • 67
1 vote
1 answer
1k views

Symmetrize a histogram plot or array?

I have a histogram that runs from -5 to 5 that I can manipulate and plot as I please, and I use the following PDF's to run one-sample KS tests on it: norm, cauchy, students t, laplace. However, I ...
layces's user avatar
  • 161
1 vote
1 answer
528 views

Convert a Histogram which has two variables plotted on it into a smooth Curve

Here is the code for generating the histogram. For the full code you can refer to this iPython Notebook # Splitting the dataset into malignant and benign. dataMalignant=datas[datas['diagnosis'] ==1] ...
djokester's user avatar
  • 586
0 votes
1 answer
661 views

How to plot gaussian-like histogram (definitely NOT a gaussian over a histogram)?

For an assignment I'm asked to plot, in front of a histogram, the histogram of a gaussian distribution. The question is simple, as I already know how to plot the gaussian on top of histograms (and ...
condosz's user avatar
  • 573
1 vote
0 answers
249 views

Plotting histogram with python 2.7 with log scale on y axis

I want to plot an histogram in python 2.7 whith a log scale on y axis: I wrote this code: plt.hist(lifes,100, log=True) But the results of histogram changed for the two axis like this: But in the ...
Rabih Assaf's user avatar
1 vote
1 answer
235 views

marking specific ordinates on pandas hist

I have a Pandas DataFrame of which I plot histogram of counts using DataFrame.hist(), for example my_v['v'].hist(bins=50) Of course, there is a grid, but I would like to add vertical lines for ...
Matt's user avatar
  • 813
2 votes
2 answers
4k views

Python Matplotlib histogram bin shift

I have created a cumulative (CDF) histogram from a list which is what I wanted. Then I subtracted a fixed value (by using x = [ fixed_value - i for i in myArray]) from each element in the list to ...
laserpython's user avatar

15 30 50 per page