bar-chart

Centered bars on a Google Chart BarChart?

倖福魔咒の 提交于 2019-12-17 20:39:28
问题 Is there a way to use the Google Chart Javascript API to center bars on a bar chart similar to this - Google Chart Example? I would like to emulate a funnel graph wih Google Charts. Google Charts does not support a funnel type of graph. 回答1: Yes that's possible. Basically what they're doing in this example is creating a basic bar chart (http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html). To get this 'funnel' effect, they create a stacked chart (in javascript see the

R: in barplot midpoints are not centered w.r.t. bars

雨燕双飞 提交于 2019-12-17 20:36:20
问题 I have just noticed something strange using barplot in R. Let y be the vector > y [1] 24924006 15310556 11638412 9542834 8696133 Using barplot on y I arrive at the vector of midpoints bp <- barplot(y) Plotting both bars and midpoints I notice that the bars are not centered .w.r.t. the midpoints...and this is odd; in summary, I use bp <- barplot(y) points(bp) with as outcome. Could you please help me solving this little puzzle? I would just have bars with centered mid-points. Thanks! 回答1: If

Ordering stacks by size in a ggplot2 stacked bar graph

☆樱花仙子☆ 提交于 2019-12-17 19:19:38
问题 So i have a load of data which I have sampled as an example below: Sequence Abundance Length CAGTG 3 25 CGCTG 82 23 GGGAC 4 25 CTATC 16 23 CTTGA 14 25 CAAGG 9 24 GTAAT 5 24 ACGAA 32 22 TCGGA 10 22 TAGGC 30 21 TGCCG 25 21 TCCGG 2 21 CGCCT 22 24 TTGGC 4 22 ATTCC 4 23 I'm only showing the first 4 words of each sequence here, but in reality they are "Length" long. I am looking at the abundances of sequences for each size class that I have here. In addition, I want to visualise the proportion of

Filling bars in barplot with textiles in ggplot2 [duplicate]

狂风中的少年 提交于 2019-12-17 19:15:07
问题 This question already has answers here : How to add texture to fill colors in ggplot2 (8 answers) Closed 3 years ago . test <- data.frame(a=c(1,2,3,4), b=c(4,4,4,4)) ggplot(test, aes(x=a, y=b, fill=factor(a)))+geom_bar(stat='identity') but i also want to add texitiles in this plot, something like: Thank you very much 回答1: Hey folks here's a wee hack that addresses the texture issue in a very basic fashion: ggplot2: make the border on one bar darker than the others using R EDIT: I've finally

How to plot multiple horizontal bars in one chart with matplotlib

帅比萌擦擦* 提交于 2019-12-17 18:59:15
问题 Can you help me figure out how to draw this kind of plot with matplotlib? I have a pandas data frame object representing the table: Graph n m <string> <int> <int> I want to visualize the size of n and m for each Graph : A horizontal bar chart where for each row, there is a label containing the Graph name to the left of the y-axis; to the right of the y-axis, there are two thin horizontal bars directly below each other, whose length represents n and m . It should be clear to see that both thin

ggplot geom_bar: stack and center

筅森魡賤 提交于 2019-12-17 18:51:34
问题 I have a dataframe with shares in percent,columns representing different items, rows the respective share of interviewees answering in different categories. I want to produce a stacked barchart. library(ggplot2) library(reshape2) test<-data.frame(i1=c(16,40,26,18), i2=c(17,46,27,10), i3=c(23,43,24,10), i4=c(19,25,20,36)) rownames(test)<-c("very i.","i.","less i.","not i.") test.m<-melt(test) ggplot(test.m, aes(x=variable, y=value, fill=value)) + geom_bar(position="stack", stat="identity")

Matplotlib Python Barplot: Position of xtick labels have irregular spaces between eachother

浪子不回头ぞ 提交于 2019-12-17 18:42:06
问题 I'm trying to do a bar plot for many countries and i want the names displayed a bit rotated underneath the bars. The problem is that the spaces between the labels are irregular. Here's the relevant code: plt.bar(i, bar_height, align='center', label=country ,color=cm.jet(1.*counter/float( len(play_list)))) xticks_pos = scipy.arange( len( country_list)) +1 plt.xticks(xticks_pos ,country_list, rotation=45 ) Does anyone know a solution? Thanks! For your Help. Christian 回答1: I think the problem is

Width of the bar in Jfreechart

半世苍凉 提交于 2019-12-17 18:39:10
问题 Is there a way to adjust the width of the bars in a Barchart? I create my chart with the following code. final JFreeChart chart = ChartFactory.createBarChart("Report", // chart title "Date", // domain axis label "Number", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? ); 回答1: You can also set the maximum width of a bar. This is useful if you have a wide chart but occasionally there are only one or two

Bar chart using achartengine

风流意气都作罢 提交于 2019-12-17 17:46:13
问题 I want to draw a bar chart which contains five individual bars - I have used Achartengine. I am able to display all five bars in the same color but I want to differentiate one bar with a different color, but I cant display more than one color. Please show me how to display different colors. My code... values.add(new double[] {21,56,33,10,20}); int[] colors = new int[] { Color.rgb(227, 121, 15) }; XYMultipleSeriesRenderer renderer = buildBarRenderer(colors); setChartSettings(renderer, "", "",

How to add XY-line to bar chart creating a multitype chart with another axis?

[亡魂溺海] 提交于 2019-12-17 17:22:39
问题 Just wondering if there would be a possibility to create such a Jasper report chart that would be a combination of many chart types? In my case I would like to combine Bar Chart and XY Line on two different axis. I already have a following kind of bar chart ready: Ideally I would be able to add one XY-line in the same chart as well, which would present the cumulative value of the sum of all hour types for each month.See picture at the end. I have a feeling that this is not possible, and maybe