bar-chart

R: Lattice How to remove white space between bars and x axis?

。_饼干妹妹 提交于 2019-12-11 06:50:38
问题 I am new to R and am using lattice to create a clustered bar graph. I wrote the following code. nature <- read.table(text = "Nature_of_recreation, Familiarity_with_the_partner, Count Danced, Not familiar at all, 21 Danced, Not very familiar, 22 Danced, Very familiar, 22 Sketched, Not familiar at all, 6 Sketched, Not very familiar, 17 Sketched, Very familiar, 16 Dined, Not familiar at all, 16 Dined, Not very familiar, 14 Dined, Very familiar, 10 Swimmed, Not familiar at all, 6 Swimmed, Not

MPAndroid BarChart label count and ValueFormatter not working properly

断了今生、忘了曾经 提交于 2019-12-11 05:55:22
问题 I have an issue with the BarChart and labels. The labels count is not correct. Even if I put a value directly: xAxis.setLabelCount(5,true); but what I get is only 4 labels. When I put 6 it becomes 5. It seems there is a bug. Also the last item of the labels ( I am using a simple ValueFormatter) does not appear. If the number of labels equals the number of bars it repeats the first one twice even though I use the xAxis.setGranularity(1f); xAxis.setGranularityEnabled(true); and the x values for

Is there a way to have a barplot and a stacked barplot on the same graph using barplot or ggplot?

醉酒当歌 提交于 2019-12-11 05:15:52
问题 I have two pieces of data that I want to overlay onto the same plot. I've looked at several ggplot articles and I don't think it's possible within ggplot. So I have been using barplot. I have 5 tiers and I'm plotting total dollars by tier as a solid bar. Then I have another piece of data that represents the number of tasks within those tiers by two different types of workers. I have this as a stacked bar plot. But I want to show them on the same graph with the total dollar amount as one bar

Plotting bar plot in Seaborn Python with rotated xlabels

霸气de小男生 提交于 2019-12-11 04:44:25
问题 How can I plot a simple bar graph in Seaborn without any statistics? The data set is simply names and values. import pandas df = pandas.DataFrame({"name": ["Bob Johnson", "Mary Cramer", "Joe Ellis"], "vals": [1,2,3]}) I would like to plot this as a bar graph with xlabels pulled from name column and y-axis values from vals and have x-axis labels rotated 45 degrees. How can it be done? Using sns.barplot like: sns.barplot(x="name", y="vals", data=df) will compute statistics that are not relevant

ggplot: How to connect certain bars in a chart with arrows

陌路散爱 提交于 2019-12-11 04:34:22
问题 At the moment I am replicating/updating certain graphics for a poster presentation. I managed to replicate colours, values, the bar-style and background of the graphic. But there's an arrow-label missing, highlighting a value-difference. I wonder whether there's an useful option via ggplot (lines or arrows), worth the effort - alternatively I have to draw some arrows with another graphic-software ... Here's what I try to do: Here's what I already have: The data and code: weight <- c(113.2158,

order data to plot barplot in ggplot2

烈酒焚心 提交于 2019-12-11 04:16:45
问题 I need to build a barplot of my data, showing bacterial relative abundance in different samples (each column should sum to 1 in the complete dataset). A subset of my data: > mydata Taxon CD6 CD1 CD12 Actinomycetaceae;g__Actinomyces 0.031960309 0.066683743 0.045638509 Coriobacteriaceae;g__Atopobium 0.018691589 0.003244536 0.00447774 Corynebacteriaceae;g__Corynebacterium 0.001846083 0.006403689 0.000516662 Micrococcaceae;g__Rothia 0.001730703 0.000426913 0.001894429 Porphyromonadaceae;g_

How to show values stacked bar chart utilizing dc.js and d3.js?

时光怂恿深爱的人放手 提交于 2019-12-11 04:16:24
问题 Based on this question, I was able to create a bar chart using dc.js and d3.js with labels. However, I turned the bar chart into a stacked bar chart (based on this documentation), and I'm having difficulty showing the labels for each of the stacks. For example each stack in the below chart should show the number, but it's showing [object Object] See below for code and here for codepen Javascript var data = [{Category: "A", ID: "1A"}, {Category: "A", ID: "1A"}, {Category: "A", ID: "1A"},

Showing spaces between bars in android

旧街凉风 提交于 2019-12-11 03:44:58
问题 How to mention the spaces between the bars of a bar-chart in android? Thanks in advance!.. Above the image will make you clear about my doubt.ie,. The blue bars are actually not fit to the corresponding x-axis values,here are (Ord_1,Ord_2,Ord_3,Ord_4). I need to show these bars fitted with the x-axis values.How to do this? Please find my sources below BarChart.java public class BarChart extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle

MS chart candlestick How to set tail colors

随声附和 提交于 2019-12-11 03:38:03
问题 I am currently developing a candlestick chart with mschart in visual C#. I have now created two charts and created the charts as follows Question 1. View the Candlestick Chart at the top. I would like to apply the tail color of each rod as red or blue. Question 2. View the bar chart at the bottom. I would like to apply Red or Blue color to this chart. I want to apply the same color to the top of the Candlestick chart. How can I do it ? [source] DataTable table_ChartData = new DataTable();

how to add data labels for bar graph in matlab

ⅰ亾dé卋堺 提交于 2019-12-11 03:24:52
问题 For example (code): x = [3 6 2 9 5 1]; bar(x) for this I need to add data labels on top of the each bar. I know that I have to use TEXT keyword, but I'm not getting how to implement it. 回答1: Based off this answer: data = [3 6 2 9 5 1]; figure; %// Create new figure hbar = bar(data); %// Create bar plot %// Get the data for all the bars that were plotted x = get(hbar,'XData'); y = get(hbar,'YData'); ygap = 0.1; %// Specify vertical gap between the bar and label ylimits = get(gca,'YLim'); %//