Questions tagged [bar-chart]
{bar-chart} is about creating bar charts using TeX/LaTeX/etc.
636
questions
0
votes
0
answers
16
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 ...
0
votes
1
answer
29
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 ...
1
vote
1
answer
64
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 ...
1
vote
1
answer
44
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{...
0
votes
0
answers
18
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 ...
0
votes
0
answers
23
views
Merge 3 bar plots
I would like to merge 3 bar plots
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
[
ybar,
...
0
votes
0
answers
16
views
Overlapping labels for short stacked bar chart
Does anyone have an idea how I can avoid that the labels of the stacked bar chart for short bars overlap? The scaling of the x-axis must not change.
My idea was to write the labels one after the ...
2
votes
0
answers
19
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}[...
0
votes
0
answers
73
views
3D stacked bar histogram with pgfplots
I would like to plot a 3D stacked histogram like this (generated with Excel) with pgfplots:
The data are as follows:
Category Val1 Val2 Val3 Val4 Val5
Cat1 20 23 13 ...
1
vote
2
answers
80
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 ...
1
vote
0
answers
27
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 ...
1
vote
1
answer
61
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 ...
1
vote
1
answer
132
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, ...
2
votes
1
answer
71
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{...
1
vote
1
answer
54
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, ...
1
vote
1
answer
73
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},
...
2
votes
2
answers
57
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 ...
2
votes
1
answer
54
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 ...
0
votes
1
answer
33
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}...
1
vote
1
answer
42
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 ...
0
votes
0
answers
27
views
I have problem with the fifth column which disappear in the graph
\documentclass{article}
\usepackage{pgfplotstable} % loads pgfplots which loads tikz
\makeatletter
\newcounter{groupcount}
\pgfplotsset{
draw group line/.style n args={5}{
after end axis/...
2
votes
0
answers
63
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 ...
0
votes
1
answer
38
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{...
0
votes
1
answer
52
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 ...
0
votes
1
answer
46
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 ...
0
votes
0
answers
13
views
How to insert text in each bar of the bar chart [duplicate]
How can I implement bar chart with text in each section of the bar
\begin{itemize}
\item first thing
\item second thing
\item third thing
\end{itemize}
\pgfplotstableread{
Label failure success
...
0
votes
1
answer
27
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}
\...
0
votes
0
answers
16
views
my values are overriding as these value are very small i have rotated tha bar values but the problems still exists can you please help
\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usetikzlibrary{patterns}
\begin{document}
\caption{Existing Scenario:
Mode Wise Percentage Share}
\centering
\begin{...
1
vote
1
answer
85
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 ...
2
votes
1
answer
75
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 ...
0
votes
0
answers
19
views
Problem my ylabel is printed twice and i want y axis to be scaled in percentage,also want bar chart to show values in percentage
\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usetikzlibrary{patterns}
\begin{document}
\begin{figure}
\caption{Existing Scenario:
Mode Wise Percentage Share}
\...
0
votes
1
answer
35
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{...
2
votes
3
answers
129
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 ...
1
vote
1
answer
51
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}
\...
2
votes
2
answers
444
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}
...
0
votes
1
answer
54
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 ...
0
votes
0
answers
17
views
How to hide labels in small bars (PGFPlots bar chart) [duplicate]
How can I remove labels in bars that are too small? For example, I don't want "1B Long" to be there.
Thank you
\documentclass{article}
\usepackage{pgfplots, pgfplotstable}
\pgfplotsset{ ...
0
votes
1
answer
53
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 ...
1
vote
1
answer
78
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, ...
1
vote
2
answers
51
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}
...
1
vote
1
answer
55
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{...
0
votes
1
answer
66
views
Stacked bar chart from data table, formatting of point meta
I've got a data table with multiple y values per x that I have arranged as a stacked bar chart. It seems that pgfplots can calculate percentages from absolute values, but I calculated the percentages ...
2
votes
2
answers
83
views
Bars intended to be stacked are shifting and NOT Aligned
I am trying to create a stacked bar chart, but when I plot the three sets of datapoints, they are not aligned/shifted incorrectly.
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\...
0
votes
1
answer
61
views
Show 0 when printing nodes near coords in chart bar
Problem description:
I would like for all values including 0 to be shown above bars in a chart bar. As I am new to latex, I assume something is set in nodes near coords that prevents 0 from showing. ...
1
vote
1
answer
93
views
pgfplots - color part of bars above given value different colour
I have written the latex commands below to produce a bar plot shown in the screenshot.
What I want to do next is to colour each of the highlighted tip of the bar with a stronger colour as shown in the ...
1
vote
1
answer
80
views
Bar chart: Have values, not percent, on the Y axis, but keep percent and values for every node
Problem Description
I would like to have the node of each bar being the actual value and its corresponding percentage, but on the Y axis I would like to have a scale of values. With my current MWE, I ...
2
votes
2
answers
372
views
3d barplot with colormap / heatmap
I'm trying to plot a 3d bar where the bars are colored with a colormap/heatmap.
I just found this solution: enter link description here to get a 3d bar plot but i dont get a solution for the colormap ...
1
vote
1
answer
39
views
pgfplots multiple addplots misalignment of symbolic x axis labels
Following is the code I have tried so far
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}
[
ybar,
error bars/.cd,
ylabel = Score,
...
1
vote
1
answer
62
views
Pgfplots ignores my last datapoint
Datapoint e will get ignored regardless of whether d - the previous datapoint - exists or not. I want a, b, c, d and e to be present in the plot in a bar plot that groups the bars by two (so feel free ...
1
vote
1
answer
66
views
Error bars in pgfplots symlog bar chart not working
I'm trying to create a bar graph with symlog axes and black error bars.
However, the best I got so far is below. Now my error bars disappear behind my bars and have colors that are not black for some ...