about creating bar charts using TeX/LaTeX/etc.

learn more… | top users | synonyms

1
vote
1answer
22 views

Fail to produce valid PDF from pgfplots sample code

I use the following the pgfplots sample code: \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
1
vote
1answer
40 views

How can I make legends colourful? And how can I put value in bars?

\documentclass[border=5mm] {standalone} \usepackage{pgfplots, pgfplotstable} \usepackage{xcolor, color} \begin{document} \begin{tikzpicture} \definecolor{SpecialYellow}{HTML}{F9DC21} ...
2
votes
1answer
47 views

How to specify the starting point of a horizontal bar in latex?

How to specify the starting point of a horizontal bar in latex ? For example, I want to plot a horizontal bar between (2, 5) and (10, 5), which is a horizontal bar with a length of 8 and starting at ...
1
vote
1answer
33 views

Plot a horizontal bar which doesn't start from the y axis

As stated in the title. I want to plot a bar which doesn't start from the y-axis(i.e., where x = 0). I try to use the bchart package but I fail to achieve this. For example, my latex code is like ...
0
votes
0answers
51 views

Scale y data in bar plots with pgfplots depending on x ticks

I have an issue dealing with data scaling. I consider two different kinds of information (i.e. orange and apple eaten daily) depending on three different people. Now I need to display the factor of ...
1
vote
0answers
50 views

How do I uniformly change bar thickness, box width and add error bars?

I need help with a few adjustments on this group plot. I managed to solved my previous problem but now I´m searching for a needle in a haystack. 1. How do I make the bars thinner so they may fit ...
1
vote
0answers
86 views

PGFPLOTs bar chart with zero data ymin=0 not respected

I have simple bar chart. With zero values in \begin{tikzpicture} \begin{axis}[ ybar, axis lines*=left, ymajorgrids, bar width=0.26cm, width=0.45\textwidth, ymin=0, y tick label ...
3
votes
1answer
119 views

adding single points to bar figure in pgfplots

I have a bar plot, in which I would like to add some single points overlayed on the bars. Those points are in another scale compared to the error bars. Below, I'm illustrating those single points in ...
2
votes
0answers
122 views

Zero space between bars of the same interval in pgfplots ybar interval plots

I need a bar plot (containing multiple \addplot) with following requirements: ticks between x labels (and, in this respect, my question differs from Adjusting width of ybar interval separator to ...
3
votes
1answer
360 views

Build a real histogram in pgfplots

Always in my long learning TikZ, I would build a "real" histogram from the following set of data : xi ni 1000 5 1200 8 1500 24 2500 13 3000 2 The idea is to group the data into ...
6
votes
1answer
128 views

Enlarge distance between bars

I want to create a bar chart. The bins are extremely close to each other, how can I increase the distance between the bars to let the labels on top of it stand a bit free and don't overlap anymore. ...
2
votes
0answers
79 views

Grouping bins in bar charts?

I have below bar-chart. I want to group the bars together by color. It makes no sense to compare the bins directly, but only the values with the same color directly. Is there a way to create two ...
2
votes
1answer
124 views

Creating an empty bar chart, for students to fill in data

What's the easiest way in Latex to create a simple, nice looking, empty bar chart -- I'll set up the axes appropriately, but students will fill in the data. To be specific, the bar chart will show ...
1
vote
1answer
91 views

2 histograms with common x-axis are not aligned

I have to following latex code: \usepackage{tikz} \usepackage{pgfopts} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture}[scale=1] \begin{axis}[minor tick num=1, scale only ...
2
votes
2answers
157 views

Bar chart using pgfplots with both positive and negative bars

I am trying to create a bar chart with both positive and negative stacked bars. However, my negative bar doesn't appear/it is hidden behind the positive bars. How should I change the settings to make ...
0
votes
0answers
47 views

Placing bar charts in a figure

I am trying to draw a figure with 4 basic blocks as follows: The first block is a simple labeled rectangular block (about 1.5X2cm) Immediately to the right, I want to put a rectangular container ...
3
votes
1answer
152 views

How can I add a reasonable padding to this bar chart?

I’m trying to add a uniform padding to all sides of this bar chart. In a different answer on tex.SE I have found the following code, however, I wasn’t able to find values for xmin and enlarge x to ...
3
votes
0answers
89 views

Compactifying histogram at empty tick values

I have the following histogram: \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Throughput, enlargelimits=0.15, legend style={at={(0.5,-0.15)}, ...
4
votes
1answer
154 views

Removing exponential numbers from pgfplots

I'm doing a horizontal bar chart, but in my x axis and in the number in each bar is exponential and I want a "normal" number. How can I do that? \begin{figure}[h] \centering \begin{tikzpicture} ...
4
votes
1answer
200 views

Change color of individual bars in histogram of binomial distribution

With the help of Positioning of Pgfplot axis labels I managed to create histograms of binomial distributions. What I still need is to select some of the bars and fill them with a different color or ...
4
votes
1answer
321 views

Remove space between x axis and bars in bar plot

I've created a grouped bar chart with pgfplots and pimped it with the help of a few questions here. The only remaining problem is that my x axis is at -1, whereas the bars start at 0. How do I get the ...
1
vote
0answers
124 views

Table of ybar plots with specific colors

I am trying to use specific coloring in an table of ybar plots. Maybe someone can help me out here. I have read other threads concerning the coloration of ybars but none of them really worked. This ...
2
votes
1answer
123 views

Fix group bar chart spacing

Consider the following MWE \documentclass[tikz]{standalone} \usepackage{lmodern} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{pgfplotstable} \begin{document} ...
2
votes
0answers
64 views

X label in multiple bars and problem in bars

Can someone help me in this problem? I am trying to draw an histogram, but I am having some problems. This is the histogram I have made so far: \begin{center} \pgfplotstableread{ 1 800 900 ...
5
votes
1answer
318 views

Spacing bars in ybar

I have several problems with this diagram: I am trying to create a template plot that I can use several times with different amount of bars. To simplify that I would like to define a fix bar width ...
3
votes
1answer
502 views

pgfplots: bar plots and xticklabels display

I have a bar plot and I would like to set x labels but when I do so, the x-axis is not appropriate: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
3
votes
0answers
92 views

Creating a tornado plot with pgf and force a break in one of the horizontal bars

To display a sensitivity analysis I want to produce a Tornado plot. In the plot a specific base case value is compared to the values produced after changing parameters in the model. I started from ...
4
votes
1answer
186 views

outline a plotted graph?

To outline a path in white, one usually the draw the path larger and fill it in white, then copies the original path filled in black over it. This is to better separate it from the background. But ...
4
votes
1answer
237 views

Hide y labels in pgfplots, and make coordinates fit inside of the pdfplot box

I want to compare time spent on different simulation with bars from a pgfplot that show my simulation time. Here is the code: \begin{figure}[htbp] \centering \begin{tikzpicture} ...
4
votes
1answer
259 views

Expressing a y-only shift with `axis direction cs` with symbolic x coords

I have a vertical bar chart with error bars. I want to put a star just above or below the error bar where the results are significant. I achieved this using the very neat trick provided in this ...
4
votes
2answers
311 views

Trouble with Tufte-style bar chart

I am studying this article: "Tufte-style Bar Charts with pgfplots". I was able to come up to step #4, and was stuck, removing the border from the bars: \definecolor{tufte1}{rgb}{0.7,0.7,0.55} ...
6
votes
1answer
728 views

How to draw Latex multiple bar chart with error bar

Can someone help me with putting error bars on multiple bar graphs. This is what I currently have and it doesn't look any good, so far :( \begin{figure} \begin{tikzpicture} \begin{axis}[ x tick label ...
5
votes
1answer
196 views

Unclutter a bar plot with pgfplot

I have the given bar plot with three hirachies (color + inner-group + outer-group): The figure look overloaded but I don't know how to split the x axis labels in a better way. A possible solution ...
4
votes
1answer
131 views

pgfplots: symbolic coordinates with line skipping

I am trying to skip lines inside the symbolic X coordinates of the following pgfplots Bar Chart : \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{color} \usepackage{amsmath, ...
3
votes
0answers
117 views

create bar chart from select table row(s) for select column

The code below creates a bar chart but does not use the included data table. I would like to create the chart for an arbitrary year by specifying the year and using the table. Possible? ...
1
vote
0answers
81 views

How can I horizontally align the bars of two barplots

I would like to align the clusters of the two barplots of the figure below. For instance, I would like that the cluster of "Program-2" on the second bar appeared just below the "Program-2" cluster ...
3
votes
1answer
155 views

bar chart - 'inner' x ticks?

i've successfully created my first 'bar chart' today: by the use of the code given below: \documentclass[tikz,border=1pt]{standalone} \usepackage[ngerman]{babel} ...
4
votes
1answer
239 views

Create Yes/No bar charts

I am collating data from a survey and I want to create a bar graph like the one below: Can anyone provide me with a template of that chart? I tried to inflect bar chart and stick the two together ...
0
votes
0answers
89 views

Bar Graph from a matrix

[ -1 0 1 2 3 4 5 6] [ 66247 5598 6541358 40899 1674 192 30 3] [ 58 9773 680 850448 5569 304 38 4] [ ...
4
votes
2answers
272 views

Stacked bar plot with explicit axis domain

I have a data table which contains positive and negative values for different categories (columns) as input. I want to visualize these values by a stacked bar plot, which shows a stacked bar plot for ...
1
vote
1answer
164 views

pgfplots - plusminus doesn't match its definition

I've been trying to make a ybar plot with error bar using pgfplots. I want to make this graph inside a tex template, but one weird thing has occurred - when I inserted the following code (be more ...
6
votes
1answer
156 views

plot legend : increase its area

So my question in general is what is the method to change the precise area of the rectangle used in pgf plots? Yes, to make it larger ... MWE: a typical bar chart ...
5
votes
2answers
214 views

Barplot: alternating colors, bars side by side

I'd like to have a barplot with bars side-by-side and with alternating colors. It should look like the ouput of the code below, just with alternating bar colors. (Got the idea from here) ...
3
votes
1answer
179 views

tikz ovelapping bars

The following code \documentclass[12pt,a4paper,onecolumn, openright]{report} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{figure} \centering \begin{tikzpicture} ...
2
votes
1answer
146 views

I need same label to repeat 3 times in bar chart tikz [closed]

\begin{figure} \centering \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, width = 12cm, height = 5cm, bar width=20pt, ylabel={number of ...
3
votes
1answer
45 views

pgfplots@y@inverseveclength ->infty

I'm experiencing problems with pgfplots. The following piece of code was automatically generated by a piece of software I'm working on. \documentclass {standalone} \errorcontextlines 10000 ...
2
votes
0answers
108 views

pgfplots, representing bars from same category and series adjacently

I would like to represent the number of counts from specific cell types on a bar chart. The cells are from different mutants, consequently there are four series (742, 743, 744, 745). However there are ...
8
votes
1answer
187 views

How to do a shift/offset of ycomb or ybar **in y-direction** without stacking in pgfplots?

I am looking for a way to shift the reference bars in an XRD plot in order to be able to compare two or more plots in the same axis environment but have the references only where they apply. This ...
1
vote
2answers
268 views

Bar from bar chart without value

I would like to add a single bar to my chart, but without any value. Unfortunately when I skip adding proper value with label x in coordinates, it (bar with label x) disappears from chart. ...
3
votes
0answers
136 views

Barchart, Boxplot Data Table PGF Math Errors from mixed format inline data

My code for a horizontal bar chart with a summarizing boxplot is coming together, but I still have a nagging PGF Math problem if I try to plot the boxplot values, which are commented out at the bottom ...