Questions tagged [bar-chart]

A bar chart is graphical representation of data where the value is represented by the length of the bar.

Bar charts are used for marking clear data which has discrete values. Some examples of discontinuous data include 'shoe size' or 'eye color', for which a bar chart is appropriate. In contrast, some examples of continuous data would be 'height' or 'weight'. A bar chart is very useful for recording certain information whether it is continuous or not continuous data. Bar charts also look a lot like histograms. They are often mistaken for each other.

Example of a bar chart, with 'Country' as the discrete data set.

enter image description here

Source: eNotes (Bar chart)

In scientific software for statistical computing and graphics, a bar-chart can be generated by function barplot.

8160 questions
2
votes
1 answer

How to adjust size of x-axis font using R?

Using the following R code, I made a plot in R Studio. As you see, only part of the texts due to x-axis are shown. How can I show the whole term? Also, When I plot the data, the data is plotted with regard to alphabetic or numeric order not with…
B_R
  • 99
  • 1
  • 1
  • 7
2
votes
1 answer

Bivariate histogram plot with 3d bars AND different bar colors

The histogram2 function (added in R2015b) has the DisplayStyle optional argument, which controls whether the output is displayed using "bars" (of uniform color but different height) or "tiles" (with the same height of 0, but with different colors),…
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
2
votes
1 answer

searborn increase number of colors

I am trying to create a bar plot with 11 different colors. ax = sns.barplot(x=newx, y=newy, palette=sns.color_palette("Set2", n_colors=len(pairs))) But I am getting only 8 different colors, and the last 3 bars repeating the colors of the first 3…
LetzerWille
  • 5,355
  • 4
  • 23
  • 26
2
votes
1 answer

Table format won't show x values

I have a table with a header that seems to be ruining my plots. | Header2 | --------+---------+ a | 1 | b | 5 | c | 7 | I want to barplot the x and y values against each other, and I can, but it does…
Dr.Doofus
  • 55
  • 1
  • 1
  • 10
2
votes
1 answer

geom_bar: stack without adding

I want a bar chart that looks stacked, but that the values are the actual values rather than being additive. I'm graphing things at ages, and ages don't "add". The data below show that the oldest animal lives to be 31 days old. However, the…
datakritter
  • 590
  • 5
  • 19
2
votes
2 answers

Create a plot from a pandas dataframe pivot table

I'm new to python and was wondering how to create a barplot on this data I created using pivot table function. #Create a pivot table for handicaps count calculation for no-show people based on their gender pv = pd.pivot_table(df_main,…
LOR121
  • 81
  • 2
  • 2
  • 8
2
votes
1 answer

Create barplots in ggplot2 filled with flags (or images)

I'm creating a barplot using ggplot2 where each bar represents a country. I would like the fill of each bar to be the country's flag for easy identification. Here's a simple example library("ggplot2") DF <- data.frame(country = c("UK", "France",…
ekstroem
  • 5,957
  • 3
  • 22
  • 48
2
votes
1 answer

Creating a grouped barplot in ggplot2 showing mean values (that I do not want to enter manually)

I'm trying to create a grouped bar plot showing the mean values for the data that I am inputting, and at the same time I want to make it easily reproducible so that I can swap in other data sets that are arranged similarly. I don't want to have to…
2
votes
1 answer

How can I "auto-adjust" the category axis labels in javafx?

I am coding on a little histogram with JavaFX. I used BarChart as the node and added the XYChart series to BarChart. My code worked quite good until I found this: The labels are overlapping each other. Then when I manually resize the window: So,…
Lu___
  • 25
  • 6
2
votes
1 answer

Double bar chart creation

I want to create a bar chart like this: There are two chart bars one below the other, the first one grows upwards while the second one grows downwards. They have different scales and data. This is what I created: var doublebarSvg1 =…
user6456564
2
votes
1 answer

How to Plot the Frequency of Two Character Variables on One Barplot Overlaid with Transparency

I have two large data frames with numerous columns of class character and/or factor. I need to compare the frequency of the values they take in the first and the second data frame by overlying the frequency each pair of variables on the same bar…
DGenchev
  • 327
  • 3
  • 12
2
votes
0 answers

R, how to set multiple bar_chart plots to have the same width through grid.arrange?

I am generating multiple bar_chart plots in R with ggplot2. I am using grid.arrange to put them all together in one image. I would like them to have the same width, but my problem is that their legend labels have different length, and thus they…
DavideChicco.it
  • 3,318
  • 13
  • 56
  • 84
2
votes
1 answer

Plotly x axis values not same as input

I am trying to create a bar chart using the following table and code: tracedata1: Berth 01E 56.0 01W 0.0 02 59.0 08 …
Aasheet Kumar
  • 341
  • 1
  • 2
  • 9
2
votes
1 answer

ggplot: weighted.mean and stat_summary in a facetted bar plot

I've spent too much time trying to figure out a solution for including weighted.mean (or wtd.mean) into stat_summary and make it work properly. I've looked to several pages trying to tackle the same issue but none had a definitive solution. The main…
HariSeldon
  • 33
  • 1
  • 6
2
votes
3 answers

Summarise categorical data for bar plot

I ^ have a dataset that looks something like this: typestudy dloop cytb coi other microsat SNP methods no no no no yes no methods yes no no no no yes methods no no no no yes no methods no no no …
zoonia
  • 21
  • 3
1 2 3
99
100