bar-chart

How to Display AChartEngine bar chart properly

孤者浪人 提交于 2020-01-01 09:22:31
问题 I am using achartengine 1.0.1 (latest) and want to demonstrate a bar chart. This is what I want: My Desired Graph What I achieved so far 1:1 view: Zoom-out View: Problems: the left and right portion of graph are lost in 1:1 view. The distance between Bar is so much high. I need to reduce it. The Bar is not appropriately above the text label. The text label color is white. I tried setLabelColor() but not working. The text-size above bar is small. XAxis Text "AC", "WA" etc are overlapping with

How to plot a grouped bar chart with errors bar as shown in the figure?

别说谁变了你拦得住时间么 提交于 2020-01-01 05:42:05
问题 I am trying to plot a grouped bar chart like the one in the figure below. I found the errorbar() function, but so far I cannot figure it out how to make it. Here is my code. Y = [0.9322225 0.86225 0.8973; 0.8953635 0.862868 0.8099605; 0.7473585 0.675698 0.80484]; bar(Y, 'grouped') bar(Y, 'BarWidth', 0.5); set(gca,'XTickLabel',{'', 'ML', '', 'HSV', '', 'NCC'}); Credit: This figure is from the work of Sanin et al. "Shadow Detection: A Survey and Comparative Evaluation of Recent Methods." 回答1: !

R: How can I make a barplot with labels parallel (horizontal) to bars

[亡魂溺海] 提交于 2019-12-31 18:01:52
问题 In barplot, is it possible to make the labels parallel to the bars? Suppose we have the data frame called "data". Page PV UniquePgv 1 /photos/upcoming 5295 2733 2 / 4821 2996 3 /search 1201 605 4 /my_photos 827 340 5 /photos/circle 732 482 I want to make a barplot of PV with the Page column as the label. names <-data$Page barplot(data$PV,main="Page Views", horiz=TRUE,names.arg=names) Which Produces: The name of each bar is vertical, while the bars are horizontal. How can I make the labels

XTickLabel with variable intervals at barplot

守給你的承諾、 提交于 2019-12-31 05:24:08
问题 I have a barplot where the bars are located at the following x-coordinates: 1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,22,24,26,28,30,35,40,45,50,55,60,70,80,90 I want to show these values at the XTickLabel , however when I use figure(1); Vector = [1 2 3 4 5 6 7 8 9 10 12 14 16 18 20 22 24 26 28 30 35 40 45 50 60 70 80 90] bar(Vector,Vector); xticklabels(Vector); I get the following output, but I want that my XTickLabel to look like Vector at the corresponding values: As you can see the XTickLabel

JFreeChart Bar Chart Production

久未见 提交于 2019-12-31 03:19:07
问题 I'm trying to create a bar chart that generates a dataset from within a for loop. String scores = scoreText.getText(); String[] data = scores.split(","); DefaultCategoryDataset barChartDataset = null; for (int l = 0; l < data.length; l++) { barChartDataset = new DefaultCategoryDataset(); // barChartDataset.setValue(new Double(data[l]), "Scores", stu); barChartDataset.addValue(new Double(data[l]), "Scores", stu); System.out.println(data[l]); } JFreeChart barChart = ChartFactory

JFreeChart - XYBarChart Show Separate Bars for Each Series

自作多情 提交于 2019-12-30 10:15:24
问题 I'm creating a XYBarChart using JFreeChart and adding multiple series to it. Currently for a given x-value and different Y-values from the series, all of them are getting stacked on top of each other. Would be possible to show each series as a different bar for a given x-value? Edit : I'm posting the relevant section of my code that is used to create the chart for your reference. Note that I cannot use CategoryDataset because this does not provide zooming capabilities on the Domain Axis. This

Set different positions of axis labels and tick marks in a barplot

一个人想着一个人 提交于 2019-12-30 09:45:31
问题 I would like to realign/offset the x-axis and associated tick marks of a barplot. This should be simple but I am having trouble finding an answer. Below is some example data with 24 categories. xval = c(1:24) count = c(0.03,0.03,0.08,0.06,0.11,0.4,0.3,0.5,0.5,0.6,0.4,0.1,0.1,0.4,0.2,0.1,0.06,0.05,0.03,0.02,0.01,0.03,0.01,0.02) df = as.data.frame(cbind(xval, count)) I can easily produce a barplot with tick marks aligned at the bar midpoints using the below code: mp <- barplot(df$count, space=0

Rounding % Labels on bar chart in ggplot2

孤者浪人 提交于 2019-12-30 07:59:23
问题 q1 <- qplot(factor(Q1), data=survey, geom="histogram", fill=factor(Q1), ylim=c(0,300)) options(digits=2) q1 + geom_bar(colour="black") + stat_bin(aes(label=..count..), vjust=-2, geom="text", position="identity") + stat_bin(geom="text", aes(label=paste(..count../sum(..count..)*100,"%"), vjust=-0.75)) + labs(x="Question # 1:\n 0 = Didn't respond, 1 = Not at all familiar, 5 = Very familiar") + opts(title="Histogram of Question # 1:\nHow familiar are you with the term 'Biobased Products'?",

2x4 Lattice Barchart minimally in R?

陌路散爱 提交于 2019-12-30 07:11:27
问题 Two data files of two different measurement sessions: ECG and B ECG . Each data file contains male and female. I want to do 2 column x 4 row Lattice Barchart minimally in R where the following is a draft of the interface. I can do 2x2 barchart, see code below. There must be some more minimal way than manually just adding more and more lines to the end of the code, which is difficult to control. ECG B.ECG female female Sinus Arr/AHB Digoxin arr Furosemide arr ECG B.ECG male male Sinus Arr/AHB

How is the BarSpacing option really implemented in Mathematica?

不问归期 提交于 2019-12-30 06:24:27
问题 I'm trying to implement a DateListBarChart function that takes dated data and outputs a bar chart with the same placements as DateListPlot . It's essential that they plot data in the same horizontal position if given the same data, so they can be combined using Show . I am finding it difficult to get the settings for BarSpacing right so that the horizontal range of the plot doesn't change, and the bars stay in essentially the same place. I have been unable to infer the correct scaling so that