Questions tagged [bar-chart]

1

votes
2

answer
67

Views

Why isn't my barplot rearranging properly when faceting with ggplot?

So I have made this barplot with this code, bars organised in descending order, great! na.omit(insect_tally_native_ranges)%>% group_by(native_ranges)%>% dplyr::summarise(freq=sum(n))%>% ggplot(aes(x=reorder(native_ranges,freq),y=freq))+ geom_col(color='#CD4F39',fill='#CD4F39',alpha=0.8)+ coord_flip(...
delcast
1

votes
2

answer
452

Views

R: smoothing binned data in barplots with ggplot2

The data describe the distribution of commodities (apples and bananas) on the trees along the road between two villages, Villariba and Villabajo, which is 4000+ m long. The data are either already binned (i.e. are given summarized over every 500 m), or are supplied with big errors of locations, so b...
astrsk
1

votes
1

answer
59

Views

Long vertical bar plot with matplotlib

I need to create a Python script that plots a list of (sorted) value as a vertical bar plot. I'd like to plot all the values and save it as a long vertical plot, so that both the yticks labels and bars are clearly visible. That is, I'd like a 'long' verticalplot. The number of elements in the list v...
Titus Pullo
1

votes
1

answer
58

Views

Adding barchart into tooltip of scatterChart in nvd3 - react component not rendering

I created a scatterChart from nvd3 and then tried to customize the tooltip the way it is described here: nvd3 piechart.js - How to edit the tooltip? using chart.tooltip.contentGenerator() approach: import React from 'react' import * as d3 from 'd3'; import nvd3 from 'nvd3'; var nv = nvd3; import Bar...
Nikita Vlasenko
1

votes
1

answer
44

Views

Creating a bar chart in R from data in a file

First I have created two vectors and put them together Vectors: VektorLHI and VektorRHI sumLHIundRHI
Silvia
1

votes
2

answer
554

Views

aggregating values for bar plot

In R, I am attempting to make a bar plot that aggregates values from shared variables in a chart like so: counts3
MinkZ
1

votes
0

answer
208

Views

JavaFX BarChart doesn't display double or float values(only int,long and short)

I generated a BarChart in JavaFx using code(without SceneBuilder) and it fails to display double values on NumberAxis.I tried with int,long and short values and it works fine, but for some reason I cannot configure it to work with real numbers. Here is my code: private BarChart createBarChartMedii(M...
Bogdan
1

votes
0

answer
21

Views

Python ggplot Barchart not displaying data as expected

I'm trying to create a basic barchart using python ggplot implementation. I want the percentages on the y-axis and the type on the x-axis rotated 90deg. The code I have written is below. from ggplot import * import pandas as pd df1 = pd.DataFrame({'Percentage':[91.45, 16.73, 8.61], 'Type':['protei...
decabytes
1

votes
0

answer
56

Views

stackbar chart Dc.js - cant display top 10

I've been trying to figure it out the pass days... I'm working on developing the stackbar chart using dc.js library. There are so many dimensions(x axis) that i need to display the top 10. I heard that in rowcharts, you can use the cap() but other charts dont. I'm trying to use .data(...) but I keep...
timJIN520
1

votes
2

answer
647

Views

How to remove extra line at the bottom of bar chart using ios charts?

Using Charts library I would like to get a specific look on the second photo. What I'm able to accomplish as of now was the one at the top image. I know I'm still too far from accomplishing the right one. This is the implementation that I have for https://github.com/danielgindi/Charts as of this mom...
Jojo Narte
1

votes
0

answer
65

Views

matplotlib bar plot spacings

I'm trying to plot 3 bars per value of N. The data is: N=['A','B','C','D','E','F'] SF = (0.87,9.4,49,110,820,1752) IRT = (0.34,25,210,487,2861,5541) IRTO = (0.5,33,271,568,3031,6314) These numbers of w (width), y_pos and figsize are basically just trial and error until it looks decent enough to my e...
Esteban
1

votes
1

answer
1.2k

Views

D3 v4 - make a horizontal bar chart with fixed width

I have made a horizontal bar chart using d3 v4, which works fine except for one thing. I am not able to make the bar height fixed. I am using bandwidth() currently and if i replace it with a fixed value say (15) the problem is that it does not align with the y axis label/tick http://jsbin.com/gigesi...
Jonn Ham
1

votes
0

answer
80

Views

Bokeh: display image on plot axis legend ticks

Is there a way to get Bokeh to display an image on axis ticks instead of a string or a numerical value? For example from bokeh.io import show from bokeh.plotting import figure images = ['img1.png','img2.png','img3.png'] p = figure(x_range=images, plot_height=250, title='Stuff', toolbar_location=None...
Zwentibold
1

votes
1

answer
337

Views

Too much space between graph and legend also x labels get cut off

The names of x labels are too long to be displayed as they are, so i desided to rotate them by -45 degree xAxis.setLabelRotationAngle(-45);. The end result is shown in the picture below. As you can see the last x label gets cut off... Also there is too much space between graph and legend. Relavant...
slodeveloper
1

votes
0

answer
321

Views

Show trend on the grouped bar plot in ggplot

This is an extension of the already discussed question (I am copying the perfect data example and solution by jakub from https://stackoverflow.com/a/18162330 ) Data: raw
J.Julian
1

votes
1

answer
193

Views

JavaFX Bar Chart Color Change

How do I change the color of the bar chart in JavaFX. It's always orange and I can't figure it out. I have literally no clue. Thanks! Here is the code: public void grafikErstellenFuerAuslastungUnterEins() { final CategoryAxis xAxis = new CategoryAxis(); final NumberAxis yAxis = new NumberAxis(); fin...
Huli
1

votes
1

answer
828

Views

How can I add the number of observations to a Seaborn barplot?

I want to add the number of observations to Seaborn barplots. I created a barplot with four bars that represent percentages on the y axis. I want to add a label on each bar showing the number of observations. In my code, the first block creates the barplot. I created the second two blocks of code...
MarkInSF
1

votes
2

answer
62

Views

How to plot advance hist in R

I'm traslating from Excel to R in order to achieve better result. So actually i got a data.frame like this: A B C D E F G 0 0 0 0 0 0 0 2 0 0 0 0 0 0 2 0 0 2 0 0 1 1 0 0 2 0 1 0 So [A:G] are the name of the columns that can just contain 0, 1 or 2 as number. What i would like to do is plot a histogra...
Rufyyyyy
1

votes
1

answer
64

Views

How to display side by side bar plot as well as stacked bar plot in the same figure in R?

I have the following dataset with variables: X_rfhlth : 'Good' or 'Bad' health X_imprace : 'Asian' ' White', 'Black' etc Sex: Male, Female I want to create a bar plot for proportions which is stacked as well as side by side. Each pair of bars will represent a race, the stacked bars will represent go...
Luv
1

votes
1

answer
465

Views

Shifting the Position of X-Axis in a ggplot bar chart in R

The given script creates a horizontal bar plot using ggplot2 package. I want to shift the x-axis details and label on top of the chart. Please help. library(ggplot2) library(plotly) time
Robert J
1

votes
1

answer
1k

Views

D3 horizontal Barchart using react-d3-components package

I am using react-d3-components for D3 chart. i am successfully generating the Bar chart. but my requirement is to generate horizontal bar chart var React = require('react'); var ReactDOM = require('react-dom'); var d3 = require('d3'); var BarChart = require('react-d3-components').BarChart; var data...
Sangram Badi
1

votes
0

answer
200

Views

How to set stacked bar chart graph “Fit to page size” report using Jaspersoft studio?

How to set stacked bar chart graph 'Fit to page size' (the graph should cover the whole page and stretch according to data without overlapping) in jasper report using Jaspersoft studio ? I have taken 'Chart_elememt' inside 'Frame_element'. I have tried changing the appearance properties of Chart_ele...
1

votes
1

answer
57

Views

2grouped bar plot in R

I am trying to create a graph with months that represent the seasons, that every seasons will be in different color with the legend below. seasons: December, January, February- Winter March, April, May- Spring June, July, August- Summer September, October, November- Autumn and the the Airports will...
Lital Dayan
1

votes
0

answer
21

Views

How to plot spikes of neurons' data set?

I have a dataset that you can see below. I just wanted to plot these spikes of neurons in one graph such as barchart. How can we plot and show this graph visually sensible. I am using Excel at the moment; however, Matlab, Python, R any programming language, software or tool would be helpful. TIME...
Vural Erdogan
1

votes
0

answer
158

Views

Pandas create histogram with custom sort order

I am trying to create a histogram of education. However, my data is such that the edu variable is categorical: '10', '11', '12', 'GED', etc.. I want a histogram that goes in that order '10', '11', '12', 'GED', '13', etc. My two approaches are: 1: Use pd.DataFrame.hist with a new variable that maps e...
As3adTintin
1

votes
0

answer
17

Views

How to align x-Axis with bar chart?

Currently I have this, but the dates are not aligned. Any suggestions? Also, why do some months appear twice, if I only add 1 time each month?
Escaga Seen
1

votes
0

answer
45

Views

mpandroidchart differnt label color for y-axis

I am using the library com.github.PhilJay:MPAndroidChart:v2.0.9 for displaying a barchart . I want to set different colors for each label in the Y axis. Is it possible to do this? How do I do this?
Joe
1

votes
1

answer
120

Views

geom_bar how to make multiple series not stack

I'm trying to solve a simple problem, I want to show in dollar terms how revenue, expense and contribution margin would look over a number of years. However, using geom_bar, the values stack on top of one another. How do I plot the expense and contribution margin within the revenue bar. Now, I know...
cephalopod
1

votes
0

answer
169

Views

How to label a horizontal barplot bar with positive and negative bars? (ggbarplot)

I am trying to plot a horizontal barplot with the ggbarplot function (ggpubr package), and this is what I have so far: = There are a couple of things that I want to change. First of all I would like to have more space in between the vertical axis labels, so the barplot would have to become longer i...
Keith
1

votes
0

answer
82

Views

Barplots using centroids in R

I'll like to create several barplots using centroid locations to position them. I already have a plot code for the polygons I want to combine them with. These are from a floor plan and not a geographical area around the world. Unfortunately, I have several points unlike the example in the link below...
Joke O.
1

votes
0

answer
92

Views

ggplot returns a stacked barplot instead of a seperated barplot

I'm trying to make a barplot to show the difference in IAT results between men and women when given one of four treatments (using R). I found some code online that resulted in something similar to what I want: library(ggplot2) ggplot(data = visits, aes(x = frequency, y = percent, fill = category)) +...
marblewhite
1

votes
1

answer
297

Views

mpAndroidChart: Bar Chart only accepts fixed height

i am having the same problem as this guy - my bar chart will only accept a fixed height in dp. If I use Fill-Parent, match_parent or wrap_content, the chart will be flat with a height of zero. And working with fixed sizes will not work on different screen sizes. While this question is already floati...
Apfelsaft23
1

votes
3

answer
51

Views

How to store data in 1096 columns

Main moto is to render a bar graph in my rails app (using highcharts). I have a CSV (30MB) file of data (static data), with 1096 columns and 14000 rows. I want to be save it in database(MYSql). Initially i thought to save as an array. Can you please tell me how it to be done (by keeping data perform...
raven
1

votes
1

answer
78

Views

How is it possible to save/download a barplot in R shiny?

I would like to save/download my barplots in shiny. I did it with ggplot, with ggsave and it was possible, but how can I do it for barplot()? My code in ui.R is: library(shiny) library(shinydashboard) library(ggplot2) ui
Belfort90
1

votes
0

answer
112

Views
1

votes
0

answer
318

Views

MPAndroidChart - Horizontal bar chart - how to align x axis label to left align, align bar value to left on negative bar chart

i am new to MPAndroidchart, here i have some issue with horizontal bar chart 1.how to align x axis label to left align 2.how to align bar chart value to left side of bar for negative numbers 3.how to fix avoid gap where x-y axis meet when axis line with is more 4.how to fix bar overlapping on top o...
gopiraj b
1

votes
0

answer
63

Views

d3.js: Getting the new (x,y) coordinates of each bar as the chart is zoomed/dragged

I am using the basic and very useful D3 bar chart with zoom/pan functionality presented at http://jsfiddle.net/9rypxf10/ I am having difficulty retrieving the new (x,y) coordinates (lower left corner) of each individual bar as the chart is zoomed and/or dragged. How can I display (x,y) in the zoom()...
Morey
1

votes
1

answer
56

Views

Matlab Bar Plot with multiple X-Axis

i've been struggling with this for some time. i want to be able to plot the following example except while using a bar plot. simple plot that needs to be converted to bar plot this was implemented by myself. This is basically two plot overlay each other with a different axes each (current example s...
Erez Posner
1

votes
1

answer
51

Views

d3js add volume bars to line graph

I built this line graph with d3js: jsfiddle Example Data: { date: '18-May-18', close: 281755783529, volume: 11792035643, notes: null } How can I use the 'volume' value from data to plot a rectangle bar corresponding to each date? The line graph with volume bars would look something like this: Thank...
joeshmoe
1

votes
0

answer
107

Views

Advanced coloring ggplot2 barplot: Two factor barplot with individual bars coloring based on values in vector

Consider the following data frame for ggplot: cor.mt o variable value o a -0.5205695 p a -0.4940820 q a -0.5997149 r a 0.4773977 s a -0.5473026 o b -0.5097157 p b -0.4837804 q b -0.5872109 r b 0.4674440 s b -0.5358914 o c -0.5385717 p c -0.5111682...
Lee

View additional questions