Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bar-chart]

about creating bar charts using TeX/LaTeX/etc.

2
votes
1answer
67 views

Select color of a bar plot from table value

I'm trying to select the color of a stacked bar plot based on the value of a cell in the line. \documentclass{article} \usepackage{pgfplots, pgfplotstable} \usepackage[utf8]{inputenc} \begin{...
3
votes
1answer
46 views

Dynamic bar plot from file

I need to draw a bar chart based on the data from the file. The data looks something like this \begin{filecontents*}{tls.dat} Name Abbreviation percentage Bod-Kin LS1 60 Intraper LS2 40 ...
1
vote
0answers
21 views

Spacing in between bars without overlap of bars, multiple plots [duplicate]

I got a problem with a plot. As you can see there symbolic xcoords and i got some plots. but the bars of the plots overlap. For example last bar vom node2 with first bar of node3. is there a way to ...
3
votes
2answers
35 views

nodes near coords from table

I want to add a non-numerical value as a node on a histogram. The labels come from a column in a table, fairly similar to this other question, i.e. using value \thisrow{<column>} as <macro>...
3
votes
1answer
66 views

3D Histogram / bar chart

Hello fellows and folks! I wanted to know if it is possible to plot a 3D histogram like these: The file is a .csv one with 100K rows/tuples. My idea is to plot users (x-axis), movies(y-axis) and ...
1
vote
1answer
20 views

Need to add an extra space between bar in TikZ

\documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure}[h] %\caption{Graph showing the proportion of children born into each partnership %scenario by ethnic group (Table 5, ...
3
votes
2answers
73 views

Changing order of draw operation in PGFPlots

I've developed a pgfplots ybar chart with white horizontal grid lines over the vertical bars to help the reader judge the length of the bars. The "base" of the ybar chart (the x-axis) is set to y=1 so ...
1
vote
1answer
34 views

Show error values on error bar

How can I show values of error on top of error bar? In the figure, I want to add values which are written with pencil in black. MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{...
1
vote
1answer
36 views

How to create numeric columns with bars in table

I wonder how could the following columns be created in (La)TeX for a table that has fixed/known column widths. I've been tinkering with tcolorbox but I couldn't find a way to make the text lay over ...
1
vote
1answer
49 views

tikzpicture with xbar interval and nodes near coords is missing an interval label

I'm trying to create an xbar interval chart with nodes near coords. This works with some shifting etc., but the interval label is missing for the topmost value (or the value is extra, depending on how ...
1
vote
2answers
64 views

Bar char/graph with node being actual value and percentage

I would like to have the node of each bar being the actual value and its corresponding percentage. Here is what I have: \begin{figure}[h] \centering \begin{tikzpicture} \...
1
vote
1answer
73 views

Change the color of two consequence bars

I have a bar chart where the first bar of each of two bars have the same color and the same for the second bar. The bar chart I have is the following: The code to produce it is: \documentclass{...
1
vote
1answer
78 views

Two consequence bars in a chart

I have bar chart that consists of 4 bars. I want to add extra four bars so that I can compare the result of each algorithm before and after a certain modification. the bar I have is the following: ...
1
vote
2answers
63 views

Change orientation of bar charts

How can the bar charts from the following code be drawn from the y-axis? \documentclass{beamer} \beamertemplatenavigationsymbolsempty \usepackage{verbatim} \usepackage{tikz} \usepackage{pgfplots} \...
3
votes
1answer
70 views

Dual y-axis plot

Want to do a dual axis plot and I am stuck with some details - maybe someone can point me in the right direction? The main problem is that both bar plots overlap! \documentclass[border=5mm]{...
1
vote
1answer
31 views

How modifying the width of xticks line in a barplot?

I have the following plot The code for obtaining it is \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} \pgfplotsset{compat=1....
1
vote
1answer
51 views

Tendency indicator for bar charts

I´d like to add an indicator to my bar chart to indicate which values are better. For example sales per days: bigger/more = better vs. bankruptcies per mio residents: less = better). Q: How do you ...
2
votes
1answer
42 views

Why 'X Group' and 'Y Group' does not appear on this pgfplot?

Why X_Group, Y_Group does not appear in this pgfplot example? I tried to change the below reference slightly, but my example does not show the grouping as in the example. Reference: https://tex....
2
votes
0answers
154 views

Tikz multi-bar plot custom bar position

I have a multi-bar plot that contains single and multi bars: I want to make the single bars A and D in the center; right now they are left aligned. The following is the code: \begin{tikzpicture} ...
6
votes
1answer
135 views

Stacked Bar Chart - How to center values inside/outside the bar?

I modified a code (found here in the forum) to produce a stacked bar chart. Unfortunately I do not understand the whole code… How can I center the values within the bar chart or right beside the chart?...
3
votes
1answer
64 views

\pgfmathprintnumber label of bar values exceeding axis values

I'm trying to only have the y-value exceeding the axis to be labelled and not the rest (as shown in the picture below). Is there any suggestion how this can be made? my MWE (thanks to @Jake): \...
3
votes
0answers
137 views

Stacked bar chart percentage label not showing

I have a stacked bar chart and surprisingly not all the percentage of the bars are shown. I only allowed values more than 3% to be shown, however some are clearly more than 3% and at the same time not ...
4
votes
1answer
167 views

Horizontal chart bars are cropped

I have the following code: \documentclass[11pt,twoside,a4paper]{article} \usepackage{pgfplots} \begin{document} \begin{figure} \small\begin{tikzpicture} \begin{axis}[ ...
2
votes
1answer
123 views

tikzpicture pgf bar plot - Add Horizontal line that starts in axis and ends after 1st group of bars

I thought about doing an extra tick but the problem is that the line isn't applicable to all bars, only the "Weight" category. Is it possible to have a line starting on the axis and ending after ...
6
votes
1answer
150 views

Plot bar chart from csv with different styles depending on row in csv

I try to plot the content of a csv file in a bar chart, where depending on the row the bar should have a different style. This is what I came up with so far: \documentclass{article} \usepackage{tikz} ...
8
votes
1answer
262 views

How to plot trinomial distribution in tikz?

I am trying to plot a 3d probability mass function like below (probability histogram for trinomial distribution). Could not find anything helpful online for 3D discrete plotting like below given a ...
0
votes
1answer
229 views

LaTeX Horizontal Bar Chart, Gradient Color for Bars

I want to create a chart for ranking like this: The top row shows the ranking (Poor - Excellent), and the left column shows the parameters. Now I want the bars to look like the figure, coloring with ...
1
vote
1answer
117 views

How to make my barchart more beautiful

I have the following code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=12cm,compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ title={Testbench: Bitzähler (...
1
vote
2answers
133 views

Editing label on bar chart

Hi I drew a bar chart and added the label onto each bar. However, as you can see I'm trying to state the relative difference between two facades, in some cases, i.e. the first two bars and the last ...
4
votes
2answers
117 views

Stacked ybar plot creates additional empty y-entries

I have this code: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{ compat=1.16, table/col sep=comma} \usepackage{filecontents} \begin{filecontents*}{data.csv} Type, fillA, fillC, ...
1
vote
1answer
104 views

Bar figure and inside text with icons

How can I reduce the the space between the age groups and add a male or female icon on the top from fontawesome package? Could the age-groups be in the middle of the male and female distribution? ...
1
vote
2answers
133 views

GRAPH OF percentages

I want create a definite structure. It's a percentage chart. This is my objective, I want to get this: I try with this code \documentclass[a4paper,twoside,12pt]{article} \usepackage[T1]{fontenc} \...
6
votes
3answers
539 views

How to use bar chart to represent percentage in table?

I want to use black and gray bar to represent some percentages. Gray is the basic color on bottom,the black is the real percentage.
4
votes
2answers
126 views

How to produce a legend with a specific text and color in a bar chart with pgfplots?

I am trying to reproduce this image What I tried is this: \begin{tikzpicture} \tikzset{every pin/.style={draw,fill=black!0!white,rectangle,rounded corners=3pt,font=\scriptsize},} \begin{...
1
vote
1answer
154 views

Grouped bar chart from csv or xlsx

I want to make a grouped bar chart in LaTeX, using data from a csv (or xlsx) file. I want it to be styled similarly to my other bar charts. I don't know how to get it into the right format and ...
0
votes
1answer
77 views

pgfplots: bar chart with scale “break” displays undesirable lines

I'm trying to create a bar chart using pgfplots that has a scale "break" in the middle, to reasonably display both small bars and very large ones. Inspired by this answer, I got very close to my ...
2
votes
1answer
96 views

Removal of white space in a bar graph

I want to remove the white space between the bars corresponding to 'kkk' in the bar graph. Please advice. Code is give below Note: Changing order of \addplot doesn't work, as it changes the meaning ...
3
votes
1answer
107 views

how to add vertical lines between bars in bar graph

I have a code adapted from this link. My problem is the adding lines and empty spaces between grouped bar graphs. This code generated bar graphs but in this bar graphs grouped bars are very close to ...
2
votes
1answer
73 views

how to convert stacked bar graph to unstacked bar graph

I need to have both line and bar graph in the graph. This link refers to stacked version of the graph that I need. Is it possible to convert it to unstacked version? In this picture, I do not need "...
0
votes
1answer
34 views

How to supress extra x ticks and make two data series in barchart closer to each other?

hello! I want to have x ticks only on x-axis points 0 and 20. I tried doing it using symbolic coordinates but it did not work out. I also want distance between two data series to be 1.5 cm. How do I ...
3
votes
1answer
46 views

error message when using nodes near coords

I'm quite new to using LaTeX, I only recently visited a course about how to use it and I now have to write a code to pass this course. Anyway, I've encountered a problem as I tried to make a bar ...
2
votes
1answer
51 views

Grouped bar chart y-axis at 0 and using < in the label

I'm new to LaTeX and I have a lot of small problems that all cause failure: I want my y-axis to start at 0 (not at -something arbitraty which it is now). I have tried ymin=0, but it does not respond. ...
0
votes
1answer
372 views

Dashed and Horizontal line in tikzpicture

Wants to draw a dashed and horizontal line starts from y=98.23 (pointed in the attached image with an arrow)in a tikzpicture bar graph. Following is the code \documentclass[10pt,journal,compsoc]{...
3
votes
2answers
82 views

ymajorgrids is printed over area style

Here is my MWE: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ area style, ymajorgrids=true, bar width=0.6cm ] \addplot+[ybar ...
1
vote
1answer
87 views

Sort stacked bar chart according to total height

I would like to sort stacked bar chart in descending order after stacking up all numbers. In other words, I want to sort according to total height. I am aware of \pgfplotstablesort but in my case ...
0
votes
1answer
35 views

How to enlarge boxplot in tickzpicture

I've got a question about a barplot using tikz. I' m not very used to tikz and I'm trying to learn how to use it for my thesis. I give you my code. I'd like to enlarge the box so the "90" over "Spagna"...
1
vote
2answers
66 views

Pgfplots: Stacked Bar Plot distorted if second plot is added

I am trying to create a stacked bar plot in oder to compare two sets of data. If I add only one plot (in this example just uncomment the other plot) everything looks perfect, but if i try to activate ...
1
vote
1answer
138 views

How to color each column in a bar chart with different colors?

I have the following bar chart and I would like to color each column differently. Both columns are in the same plot, when I separate them just to give a different color values for each one the ...
1
vote
1answer
159 views

Plot a stacked bar plot with specialised x axis range

How can I make a bar chart with custom x axis range which is from 100 to 0 then to 100? The figure should look like this: (Figure is in https://doi.org/10.1145/2971648.2971676) Also, how to make ...
0
votes
1answer
61 views

Edit bar chart column names and background?

I am using \usepackage{pgfplots} and \usepackage{bchart} to make a bar chart. I am trying to make some modifications on the current one Like I want to make the name of each to bar to be skewed to the ...