histogram

MatLab: Weird display of logarithmic z-axis and bar3

折月煮酒 提交于 2019-12-11 03:14:55
问题 I want to display a 3d histogram using bar3 plot. Using linear scales with respect to x-, y-, and z-axis gives the following result: However, since the z-values have a very large interval I want to use a logarithmic z-axis such that the lower z-values are also visible. However, setting the z-axis to logarithmic with set(gca, 'ZScale', 'log'); yields the following plot, which does not look good: Is there some extra option I need to set or is it a known bug? Thanks in advance! 回答1: This is a

different estimated rows on same index operation?

时光毁灭记忆、已成空白 提交于 2019-12-11 03:08:45
问题 Introduction and Background I had to optimize a simple query (example below). After rewriting it several times I recognized that the estimated row count on the one and same index operation differs depending on the way the query is written. Originally the query did a clustered index scan, as the table in production contains a binary column the table is quite large (about 100 GB) and the full table scan takes too much time to execute. Question Why is the estimated row count different on the

Colored histogram with ggplot2

孤人 提交于 2019-12-11 03:02:02
问题 I have a data frame with values and their associated weights. I want to make a histogram, such that each bar's height corresponds to the number of values in that bin and the bar's color corresponds to their total weight. How do I do that? Example: D <- data.frame( x = c(-0.39, 0.12, 0.94, 1.67, 1.76, 2.44, 3.72, 4.28, 4.92, 5.53, 0.06, 0.48, 1.01, 1.68, 1.80, 3.25, 4.12, 4.60, 5.28, 6.22), w = c(0.1810479, 0.2209460, 0.2974134, 0.3768152, 0.3871925, 0.4682943, 0.6220371, 0.6838944, 0.7473117,

Label histogram by bins matplotlib [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-11 03:01:45
问题 This question already has answers here : Matplotlib - label each bin (2 answers) Closed 2 years ago . I have a histogram in which I want to label the x-axis by bins. The histogram is plotted as a log log graph, but the bins are very specific. The graph: The bins: bins = [0, 0.035, 0.07, 0.15, 0.5, 1, 3, 10, 40] Is there any way I can do this? I believe it would also require getting rid of the current x-axis labels. 回答1: I wrote an example code for you. Basically, all you need was 'set_xticks'

Gnuplot: Multiplot size and scaling of one plot

余生颓废 提交于 2019-12-11 01:15:29
问题 I have this multiplot: Generated by the following code: set terminal pdf size 15,10 set output "graph.pdf" set key off set multiplot layout 5, 1 scale 1, 1 set style data histograms set style histogram set style fill solid border -1 set boxwidth 0.75 set yrange [0:178] set ytics 50 set xtics offset 0,graph 0.01 set xtics font ",20" set x2tics font ",20" set ytics font ",20" set tmargin 3 set bmargin 3 set style line 1 linetype -1 linewidth 3 set grid mxtics set xtics (0.5 1,1.5 1,2.5 1,3.5 1

Plot 2D Histogram as heat map in matplotlib

我与影子孤独终老i 提交于 2019-12-11 00:36:00
问题 I have 3-d data that I want to plot as the following histogram . For each bin I have a text file with two columns such as 1.12 0.65 1.41 0.95 1.78 1.04 2.24 2.12 etc. The first entry of the first column (in the .txt) gives me the value for the center of the first tile, the second row of the first column gives me the value for the center of the second tile etc. The second column refers to the value on the color bar. The values in the first column and also the bin sizes are logarithmically

Histogram manipulation to remove unwanted data

喜你入骨 提交于 2019-12-11 00:14:11
问题 How do I remove data from a histogram in python under a certain frequency count? Say I have 10 bins, the first bin has a count of 4, the second has 2, the third has 1, fourth has 5, etc... Now I want to get rid of the data that has a count of 2 or less. So the second bin would go to zero, as would the third. Example: import numpy as np import matplotlib.pyplot as plt gaussian_numbers = np.random.randn(1000) plt.hist(gaussian_numbers, bins=12) plt.title("Gaussian Histogram") plt.xlabel("Value"

Histogram of events grouped by month and day

断了今生、忘了曾经 提交于 2019-12-10 22:36:17
问题 I am trying to make a histogram (or other plot) of the number of occurrences of each event from a set of data from multiple years but grouped by month and day. Basically I want a year long x-axis starting from 1 March showing how many times each date occurs and shading those based on a categorical value. Below is the top 20 entries in the data set: goose Index DateLost DateLost1 Nested 1 2/5/1988 1988-02-05 N 2 5/20/1988 1988-05-20 N 3 1/31/1985 1985-01-31 N 4 9/6/1997 1997-09-06 Y 5 9/24

Color a specific bar in histogram using python

不想你离开。 提交于 2019-12-10 21:44:33
问题 I have a histogram (matplotlib or plotly) and want to color a specific bar, witch has value N in the bar range (for example if N=131 the colored bar must be 130-132). How can i do that? 回答1: When calling plt.hist() , it will return three things. Firstly an array holding the value in each bin. Secondly the values for each of the bins, and lastly an array of patches . These let you modify each bar individually. So all you need to do is determine which bin is for the range 130-132 and then

How to make the width of histogram columns all the same

▼魔方 西西 提交于 2019-12-10 21:13:36
问题 I'm having a bit of trouble manipulating a histogram. I have a df with two columns and I'm plotting them as a stacked histogram. I'm putting them into specific bins (see code below) but I want to make one large bin at the end (4000-10000). However, by default the column width of the large bin is huge.. Is there a way to make this large bin not larger in size? For all of the columns to be the same width even if their x-range is uneven? Code: df.plot.hist(stacked=True, bins=[0,400,800,1200,1600