about creating bar charts using TeX/LaTeX/etc.

learn more… | top users | synonyms

2
votes
1answer
35 views

Positioning tikzpicture and determining range for axis

In another question I got great help creating this picture: Actually it looks how it should but there are two further things I would like to clarify: Firstly, I get this warning: Axis range for ...
2
votes
3answers
117 views

How to do a chart with stacked bars, lines and “sections”

The problem I need a chart like this (this was made in Libreoffice + some gimp): Its caracteristics are bassically: Some stacked bars (if it is a stacked area, better) with its Y axis at the ...
0
votes
1answer
30 views

How to unstack grouped bars in pgfplots bar-charts

I am sure this is quite a trivial problem, but I cannot seem to figure it out. I have a bar-chart with preferably three groups of four bars. The thing is, using the MWE below, the four bars per group ...
3
votes
1answer
84 views

Basic Bar Plot with long text legend, horizontal guides and percentage values

I am new to pgfplots and actually I want to create something pretty basic. Yesterday, I started modifying my chart with the help of the pgfplot manual and the help of Google but unfortunately, I ...
4
votes
1answer
54 views

Misplaced nodes near coords in stacked ybar plot

I have this stacked ybar plot and having trouble to proper align the nodes near the coords. It works fine on all bar but the one with offset 65. I already tried \ifnum as @Jake suggested here: How can ...
3
votes
1answer
61 views

pgfplots legend with two ordinates (lines and bar chart)

In the legend, I would like to have a line for the red and orange lines (as it is the case), and ybar legend style for the rest. I just can't figure out the easiest/best/any way to do it. MWE: ...
5
votes
1answer
154 views

colour each x co-ordinate with a different colour in a bar plot in pgfplot

I want to cycle colours for each x co-ordinate in a bar plot. Is it possible? For instance, in this example I want each metric to appear in a different colour. This question Colors and legend in ...
4
votes
1answer
89 views

How to evaluate the height of a ybar to change color of label accordingly

Problem I want to change the color of a node near coords label depending on the height of the bar it lies on. That is, if the label is outside the bar I want to put a color that is different from the ...
0
votes
1answer
32 views

Changing color on advanced bar chart (pgfplotstable)

I have made a stacked and clustered diagram, based on this brilliant answer: http://tex.stackexchange.com/a/55559/93892. However, I would like to change the colors of the bars. The most important ...
0
votes
1answer
71 views

how to insert number inside the stacked bar?

I tried stacked graph but i need inside bar to set alphanumberic like p1,p2,p3. My MWE \documentclass{article} \usepackage{pgfplots} % to print charts %\pgfplotsset{compat=1.8} ...
1
vote
2answers
78 views

How can stacked bars be plotted?

I try to create a stacked bar plot with given values with the pgfplots package, but it shows some errors. Can anyone correct the given errors? \documentclass[border=10pt]{standalone} ...
1
vote
0answers
42 views

From a bar chart with multiple values per ticks to a stacked bar chart

I succeeded to generate a bar chart from a table which provides multiple values per ticks. The code is given in the following code: \documentclass{standalone} \usepackage{pgfplots} ...
8
votes
1answer
91 views

Two plots, change bar plot reference system only

TL;DR How can I make a horizontal bar plot with the origin on the right? I wanted to combine several plots in a unique figure. I have a custom scatter plot, and I want to overlay it on top of a bar ...
1
vote
0answers
18 views

Insert space after each second bar

I have a bar plot which shows 7 bars for one xtick. I want to group two bars by inserting some space after each second bar. I tried to use xshift in the \addplot command, but the color of the bar ...
2
votes
2answers
63 views

pgfplots: annotate each bar in a group with custom values

how can I add custom annotations to each bar in a grouped bar chart? I know how to display the values from the the bars (with every node near...), but the values I need to display, above or below the ...
2
votes
1answer
68 views

Pgfplots: vertical bar char prints only labels at one bar

I want to create a vertical bar charts with two bars in it. At the x-axis the bars shall be labeled with A and B. The label A is printed although it is not exactly properly positioned, but the label B ...
4
votes
1answer
84 views

Add areas in background of histogram

I would like that my histogram has areas in background (with name), in order to compare the value of each bar with some intervals. This is the result that I would like to reach: And this what I ...
2
votes
1answer
81 views

Symbolic Labels in pgfplots Bar Chart

In the following code, why do I have to type the x-axis labels explicitly in the axis options and not just use the labels from the coordinates data? Is there a way to just use the data from the ...
0
votes
1answer
117 views

How to draw multiple bar charts each one with multiple different series

I want to draw a chart which includes multiples bar chart, and each one include different series. This is what I ´ve already have. In this case Alg 1, Alg3,..., Alg 7 would be my multiple bar charts, ...
1
vote
0answers
87 views

Two axis y discontinuity=parallel

I am trying to complete this bar graph with two y discontinuities since my third coordinates are too far from the remaining two coordinates. Below is a MWE can anyone provide me with an approach to ...
4
votes
1answer
78 views

Barchart with pgfplot in beamer slides

I am trying to use a code in my beamer presentation for a barchart that I had previously used for an article type document. I am using TeXstudio as the editor. Everytime I try to compile, the ...
4
votes
1answer
100 views

pgfplots ybar plot with 2 y axes and equal shift on x axis

I am trying to create a ybar plot with two y-axes and proper alignment on the x-axis. I have two data sets to compare and what I'm trying to get is the look of a normal ybar plot with horizontally ...
1
vote
1answer
148 views

PGF barplot with two y axis

I added a new axis to my barplot and that has a different scale as the first one. The second axis is shifted and does not have the same height as the first one. What do I need to change so that the ...
3
votes
1answer
60 views

Tikz stacked ybar chart shows incorrectly when I change the lower limits of the y axis

I have a problem with my picture generated using the tikz package. I would like to represent a y-stacked bar plot with the correct axis scaling. When I put the lower limits for the y-axis at -100 or ...
3
votes
1answer
92 views

Adding lines to bar charts

Is it possible to add a straight horizontal black line (from (0, 0.4) until the very end of the graph) in a bar chart environment like this: Here is the code that generates this bar chart (borrowed ...
1
vote
1answer
183 views

How to correct nodes near coords position in ybar stacked?

I'm working with this ybar stacked graph, but I can't position the nodes near coords in a correct position (not over something, not outside the chart, not over other bar, not to far away...readable!). ...
3
votes
1answer
70 views

Show mark labels near marks and not centered in ybar interaval graph

I'm doing a graph with vertical bars (ybar) where each bar represents not a number (1) but a class ([-0.5,0.5]). I would prefer that tick labels on the x axis appeared near the ticks marks, so ...
3
votes
1answer
98 views

How to hide empty (value 0) ybars with pgfplots?

I'm making a ybar graph (vertical bars) where the y axis maximum reaches 150+, but a lot of values are 0's. I would like the final graph would not show a minimum bar in this 0 values, since we this ...
8
votes
1answer
216 views

Histogram: different color for each bar

I have the following code. \documentclass[a4paper,twoside,12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} \usepackage[english]{babel} \usepackage{pgfplotstable} ...
3
votes
1answer
233 views

pgfplots 3D bar chart - wrong plotting order

I am using bar3 to plot 3d diagrams in Matlab but it seems that in LaTeX the plotting order is wrong ? Is there any way to have the right order? This is a small example of the generated 2.tikz file ...
1
vote
0answers
31 views

Eliminating excessive spacing in bar graphs

How can I eliminate the spacing to the left and right of my bar graph? \documentclass[12pt]{report} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{figure} \begin{tikzpicture} ...
4
votes
1answer
425 views

Combining line chart data with bar plot

Context I recently got a paper published and was told that I need to convert the word file I submitted to latex for camera ready purposes. Problem is, I don't know LaTeX but I have always wanted to ...
3
votes
2answers
196 views

Bar plot in pgfplots using a palette using only fill

I am trying to create some nice looking bar plots, but this does not seem to be an easy task for me :) I have started out with the following: \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, ...
3
votes
1answer
138 views

Adding a trend line to a bar chart

I'm very new to LaTeX, preparing my very first document in the environment and learning on the way. I've encountered a problem with one of my plots - I'm trying to add a trend line to a bar chart to ...
2
votes
1answer
213 views

Broken bar diagram with tikz package

I am trying out tikz package to create bar diagrams and following the code example in the manual on page 82 ...
0
votes
0answers
135 views

Customize PGF bar chart bars

Ideally, I'd like to write a macro which specifies how to draw the bar of a PGF bar chart, given its height, width, and location. This seems nearly equivalent to asking how to specify a non-repeating ...
1
vote
0answers
68 views

How to make the column with line scatter graph. (Double Y)

I want to make this graph. I have only excel data.
1
vote
1answer
46 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
50 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
118 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
94 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
129 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
118 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
218 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
236 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
203 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
1k 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
205 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
113 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
264 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 ...