Skip to main content

Questions tagged [bar-chart]

{bar-chart} is about creating bar charts using TeX/LaTeX/etc.

Filter by
Sorted by
Tagged with
0 votes
1 answer
59 views

how to draw this bar chart in latex?

I am trying to replicate a plot like this one in latex. I wonder if anyone has some good example codes to share? many thanks,
Vincent's user avatar
  • 137
1 vote
1 answer
43 views

Visualization of positiv or negativ ratings

I want to do a visualization of "bad" or "good" for some parameters. It should look like this: But I have no idea on how to get those colored boxes or the format in general. Do ...
Fabian Erhart's user avatar
0 votes
0 answers
25 views

Adding Labels to Specific Bars in a Histogram

the code i currently have generates this graph: \documentclass[11pt]{article} \usepackage[review]{ACL2023} \usepackage{times} \usepackage{latexsym} \usepackage{forest} \usepackage{array} \...
Maya's user avatar
  • 11
0 votes
1 answer
44 views

Putting labels below each bar in TikzPicture

I'm trying to create a graph like this: But I can only get it to look like this using legend text, but I want to put the text directly below the bar graphs (like 0ms, 50ms, 150ms) My code: \...
Erik's user avatar
  • 13
2 votes
1 answer
86 views

Complex bar chart with data tags

I want to create a chart similar to this one that I found online 1. I have no idea if this is even possible using simple tools like tikZ and pgfplots, or if it would be recommanded to simply drop this ...
stuck's user avatar
  • 113
0 votes
1 answer
53 views

Missing labels in barchart

I'm trying to draw a barchart but the text that I underlined and colored as green doesn't seem to display. This is how it appears. The following is the code. \documentclass{article} \usepackage{...
Yevin Christopher's user avatar
0 votes
1 answer
60 views

How can I create a stacked bar graph for a 5-scale Likert chart for every row in a table?

I want to create a table to represent the response from a survey as 5-scale Likert chart for every question. The table should like as follows. [
MD. Shazibul Islam Shamim's user avatar
0 votes
2 answers
65 views

Bar chart with multicolored bars and labels

I would like to create a bar chart with a multicolored bar. The bar chart should show the length of each section. My problem is that in the first section the number always goes before the bar chart ...
Lucas's user avatar
  • 13
1 vote
1 answer
39 views

No space between bars, symbolic x, multiple plots

I want to typeset a ybar chart with (maybe) several plots, symbolic x coordinates and a specified width so that bars have no space between them and also do not overlap. Each bar should have a node ...
ysalmon's user avatar
  • 1,160
2 votes
2 answers
49 views

How to change base value on x-achsis in a Tornado plot?

I am trying to do a tornado plot where the base value on the x-axis is different from zero, in my case 5.43. \documentclass[margin=5pt]{standalone} \usepackage{tikz,pgfplots,pgfplotstable} \...
Fantastic MsFox's user avatar
1 vote
1 answer
51 views

How to make to fix the x-axis interval of this bar graph and make it look like the following graph?

Here is the bar graph I'm trying to copy (not numbers just the graph), And here's my attempt, And here is the code, \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{...
Abdulrahman's user avatar
2 votes
0 answers
80 views

How to generate a subtotal in a bar chart (pgf tikz)

I want to generate a bar chart like this one with subtotals (here in diamond shape): I tried to work around a subtotal using a second axis, but the datapoints are not in the middle of the respective ...
Fantastic MsFox's user avatar
1 vote
1 answer
59 views

Shifted stacked ybar plot

When using a stacked ybar plot, each stacked column begins at y=0 . I would like to vertically shift the stacked column of Data B, so that its lower end aligns horizontally with the upper end of the ...
Matthias's user avatar
0 votes
0 answers
21 views

Bar chart: symbolic x cords showing multiple times [duplicate]

I have a bar chart like this There are suposed to be 4 x coords (50k, 150k, 250k, 350k) and they are being multiplied. What am I doing wrong? Here is my code. \begin{tikzpicture} \begin{axis} [ ...
ksrqm's user avatar
  • 1
1 vote
2 answers
70 views

How to add color and legends to bar chart

I am trying to create a simple chart using the code below: \begin{tikzpicture} \begin{axis}[ symbolic x coords={ Integrated Circuits, Transistors, Capacitors, ...
DEKKER's user avatar
  • 117
0 votes
1 answer
34 views

How to set max of y axis on bar chart

I tried many solutions which were about similar question, but nothing helped... I have a bar chart in Latex, which contains values from 2 550 to 18 016. I want to have numbers on y axis: 0, 5 000, 10 ...
Michaela Hanková's user avatar
0 votes
1 answer
39 views

How to write above specific bars in bar graphs using pgfplots?

I would like to put values above a few bars in my bar graph. For those bars whose value exceeds 1.7, I clip off the bar at 1.7 and write its actual value on top of that bar. Here is what I have (for ...
Programmer's user avatar
0 votes
1 answer
111 views

Different bar widths in pgfplots stacked bar chart

Below is a simple example of a stacked bar chart from the pgfplots manual. In my case, the y axis represent percentages, and the percentages in all columns add up to 100 (so like in this example, all ...
Keelan's user avatar
  • 5,445
1 vote
1 answer
103 views

Tikz bar chart, nodes near coords, remove value from a specific bar

I am using pgfplots to display a stacked bar chart. For each x-value, two bars are stacked. I need to show the y-value inside each bar and their sum on top. I managed to achieve this, however, the ...
Ronteg's user avatar
  • 13
1 vote
1 answer
55 views

Bar Chart offsets with multiple plots

I want to create some histograms and need to represent a few bar charts. However, I am facing two issues with this MWE: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{...
lurgold's user avatar
  • 13
0 votes
1 answer
36 views

Repeating axis labels in bar chart

Using the following latex: \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis} [ ybar, nodes near coords, bar width=0.4cm, symbolic x coords={2--3 times a week, 4--6 times ...
Boris Winter's user avatar
0 votes
0 answers
30 views

Merge 3 bar plots [duplicate]

I would like to merge 3 bar plots \begin{figure} \centering \begin{tikzpicture} \begin{axis} [ ybar, ...
Lorenzo Epifani's user avatar
2 votes
0 answers
29 views

Aligning Y-Axis Labels with Bar Charts using PGFPlots

I have been struggling with the following piece of code for a little while now, and I am about to give up! Hopefully someone can assist so I can show multiple bar charts in one figure. \begin{figure}[...
Wout's user avatar
  • 21
1 vote
2 answers
128 views

Drawing a bar chat (horizontal) or log line chart

I am trying to draw this graph, one is linear another is exponential and proportional to the size of the data. The numbers are so different from each other, I don't know how to make it more ...
Node.JS's user avatar
  • 685
1 vote
0 answers
46 views

Automatic calculation of error bars based on data in a bar chart

I would like to draw a bar chart using PGFPlots with error bars that are automatically calculated from the data. Here is a slightly simplified version of what I am attempting: Suppose you have two ...
bp99's user avatar
  • 605
1 vote
1 answer
199 views

Need Help with Aligning Labels Below Each Bar in TikZ Bar Chart

I am struggling with moving the labels {1, …, 6} in my bar chart. I would like to locate each label precisely at the center below each respective bar but I'm not sure how to do this. Here is the code ...
cricket900's user avatar
1 vote
1 answer
280 views

How to make histogram using tikzpicture of lot of data?

This problem is making me crazy, I have been sitting all day trying everything I can figure out without any useful results. I have a csv file like this: 3001, 3001, 15001, 7206, 7217, 7617, 15001, ...
J. Doe's user avatar
  • 113
2 votes
1 answer
75 views

Outlining the numbers at the nodes near coords

Is it possible to outline the white numbers with black? The white numbers lie inside the blue columns \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{...
UnknownW's user avatar
  • 399
1 vote
1 answer
58 views

Bars not properly displaying in TIKZ

I have run into this Issue where I try to have 2 Barcharts next to each other, but for some reason the second one is really weirdly positioned and stretched. I have similar charts with the same code, ...
Rafael Pietsch's user avatar
1 vote
1 answer
118 views

How to make coordinate value bold?

I am tyring to make this value (16.49) bold in the bar graph. I can't seem to find any answer. \begin{figure}[ht] \label{fig:table} \begin{tikzpicture} \begin{axis}[ %axis line style={draw=none}, ...
user2661372's user avatar
2 votes
2 answers
64 views

How to draw a patch inside a bar to indicate hours in a day?

Problem I would like to indicate the time duration of an event as a colored patch inside a horizontal bar, the latest representing a 24-hour timeline (i.e. a 24 units long bar), that should help the ...
Ommo's user avatar
  • 849
2 votes
1 answer
67 views

How to integrate three stacked bar charts in one figure? [duplicate]

I have a latex code for bar chart with a legend. I'm trying to add two more similar charts on the side to have 3 bar charts side by side with each chart having a sub-caption and the final figure ...
Student's user avatar
  • 197
0 votes
1 answer
35 views

Descriptive nodes for certain shifted bars in bar plot

In the example below, I want a label node for each of the bars in the middle grouping. How can I get the labels to shift to right place the same way the bars are? \documentclass[margin=5pt]{standalone}...
bongbang's user avatar
  • 407
1 vote
1 answer
46 views

Is there any simple way to change my bar graph alignment and increase its width on LaTeX?

So I'm pretty new to using LaTeX. I created this bar graph, but it's too wide to fit in my PDF doc. I don't want to rotate the graph. I also need this graph to be aligned to the flush left margin of ...
Aki Vivek's user avatar
2 votes
1 answer
94 views

pgfplots (xbar stacked): Small percentage values are getting overlapped

Problem: I want the the small values (<10% such as 10%, 7% and 6%) for N=12 and N=6 in the (a) and (b) bar-charts to be properly visible and not get overlapped with each other. I tried to change ...
Student's user avatar
  • 197
0 votes
1 answer
41 views

Bar chart values are overlapped, slice is very small to show these values

\documentclass{article} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usetikzlibrary{patterns} \begin{document} \caption{Existing Scenario: Mode Wise Percentage Share} \centering \begin{...
Muhammad Habib's user avatar
0 votes
1 answer
61 views

The ytick labels are too small and they need to be in multiple lines

Problem: I am trying to align the ytick labels in two lines as the labels look small for the figures. To reiterate, as shown from the below figure, I want N=3 in one line and add the number in square ...
Student's user avatar
  • 197
0 votes
1 answer
55 views

Y-axis labels in the bar chart should be different

I want to have three different Y-axes labels for the three bar-charts shown below. To reiterate, the labels should be N=3,N=6,N=12,N=24,N=48 for the bar-chart (a) MADDPG and N=1,N=10,N=20,N=30,N=50 ...
Student's user avatar
  • 197
0 votes
1 answer
31 views

X-axis hides behind the bars

In the following bar plot, the x-axis hides behind the bars. I need the x-axis to be view with the bars place behind it. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{decorations} \...
Ahmed Aafaq's user avatar
1 vote
1 answer
138 views

Small values in the stacked bar-chart are not visible properly

Problem: I want the the small values (5% and 6%) for N=48 in the (a) and (b) bar-charts to be properly visible and not on the grid. I tried to change the limits, increase the size but unfortunately ...
Student's user avatar
  • 197
2 votes
1 answer
99 views

Different color for single bars in a chart with multiple bars

I am currently trying to format my data in a bar chart. Here I want the bars for the first stage to be differently colored than the other ones in the same figure. I tried to achieve this using 4 ...
Krautsultan's user avatar
0 votes
1 answer
39 views

Can't add bar values to the bar, only xtick labels are showing

\documentclass{article} \usepackage{pgfplots, pgfplotstable} \pgfplotsset{compat=1.17} \usetikzlibrary{patterns} \begin{document} \begin{figure} \caption{Test Caption} \centering \begin{...
Muhammad Habib's user avatar
2 votes
3 answers
196 views

Last chart in a group of bar-charts should have two columns

I am trying to generate a group of bar charts with 3 figures and successfully completed that and the output can be seen below. Problem: I want the first two bar-charts (a and b) in the same state, but ...
Student's user avatar
  • 197
1 vote
1 answer
56 views

Y axis values are not being displayed for a bar chart

Problem: Y axis values are not being displayed on the bar chart. Output: Latex code: \documentclass[border=5pt]{standalone} \usepackage{pgfplots, pgfplotstable} \pgfplotsset{compat=1.18} \...
Student's user avatar
  • 197
2 votes
2 answers
677 views

x axis labels are getting repeated twice for a bar-chart [duplicate]

Problem 1: I am trying to generate a bar-chart with 3 bars for each chart. But as you can see from the below output, my x-axis labels are getting repeated twice. X axis labels = {3-6, 6-12, 12-24} ...
Student's user avatar
  • 197
0 votes
1 answer
63 views

Values on the bar-charts are crossing the grid

I am trying to put the values inside the grid for the charts, but as you can see from the output below, the values for data points cross the boundary (both left and right sides). My output: Latex ...
Student's user avatar
  • 197
0 votes
1 answer
74 views

Reduce gaps between groups of bars and resize the bar values for each bar

I am trying to reduce the space between the bars and also reduce the space between the values and their bars. As you can see from the figure below, the values of the bars cross the figure boundary. My ...
Student's user avatar
  • 197
1 vote
1 answer
87 views

How to align three charts with stacked bars and with captions, center alignment and main caption

The problem I need a chart like this (this was from one research paper): What I have Currently my output is displayed below: I tried to create 3 charts using the above reference diagram. However, ...
Student's user avatar
  • 197
1 vote
2 answers
71 views

Unexpected borders on legends of stacked bars in pgfplots

I would like to visualize numbers of female and male passengers on the Titanic traveling in 1st, 2nd, and 3rd class using stacked bars in pgfplots. The code here: \documentclass[crop,tikz]{standalone} ...
chenzhongpu's user avatar
1 vote
1 answer
68 views

Bar chart in pgfplots offset with missing data

I would like to create a bar plot with pgfplots where I add multiple data with successive addplot+ commands, such as: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{...
Michael F's user avatar

1
2 3 4 5
13