about creating bar charts using TeX/LaTeX/etc.

learn more… | top users | synonyms

1
vote
0answers
32 views

Add spacing between every second bar tikzpicture

So I've created this chart below from a .csv file with the code at the bottom. However I would like to add some spacing between the 2&3 bars and 4&5 bars. Is this possible or do I need to ...
3
votes
1answer
35 views

Missing xtick labels from table in bar plot whenever y value is nan

Given a picture like that: \documentclass[12pt]{article} \usepackage{pgfplots} \usepgfplotslibrary{external} \tikzexternalize \pgfplotsset{compat=newest} \pgfplotstableread[col sep=comma]{ ...
6
votes
1answer
2k views

Stacked bar-plot: display total value

Is there a way to make pgfplots display only the total value of a stacked bar-plot? With nodes near coords, all segment-values are shown: I'm only interested in the sum of the stacks, though. ...
3
votes
1answer
41 views

Assigning xlabels to symbolic x coords

I am using the below code to generate the shown bar graph. However, I cant find anything with which I can label each of the individual bars for both sets of my data. i.e say the bar marked 0.67 I want ...
1
vote
1answer
28 views

bar graph not showing the first bar with pgfplot

I have the following table in a .txt file Group Real Imag Cable VSC P-mode VSC Vdc-mode A -1.2739095e+02 -3.3612954e+02 4.9822998e-01 4.9309456e-01 8.6754595e-03 B ...
0
votes
0answers
19 views

Bar chart in Latex for numbers occurency

I have the following set of data (it is only a part, in reality is way longer than this): 200 200 0 0 4 4 4 8 20 8 20 and I'd like to build a bar plot in Latex where the X-axis reports all the ...
0
votes
1answer
80 views

How to display the y-values of each bar in pgfplots bar chart above the bar?

I am using code from this thread. link: Making one bar in a bar-graph stand out pgfplots Everything is working fine but I want to display the y-values of each bar in pgfplots bar chart above the bar. ...
5
votes
2answers
182 views

How to customize Tikz Gantt chart

I am trying to find a way to obtain the following using tikz (actually using pgfgantt): The code I have so far is: \documentclass[tikz]{standalone} \usepackage{pgfgantt} \begin{document} ...
2
votes
1answer
51 views

Density and overlapping in tikz chart

I got the following code right now for my chart: \begin{figure} \setlength{\fboxrule}{0pt} \fbox{ \vspace*{-100pt} \begin{tikzpicture}[every node/.style={font=\scalefont{1}}] \centering ...
1
vote
0answers
59 views

Drawing Bar charts with Std.deviation and Confd.level with PGFPlots

I want to draw a bar chart where on each bar it shows the standard deviation(and also confidence level). I tried using following solution but I get the "dimension too large" error. Basically I have ...
1
vote
3answers
206 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 ...
6
votes
1answer
92 views

pgfplots: change order of barplots

When one has more then one barplot in one pgfplots axis like in the following example then the red plot at the top of the code ends up as the bottom bar of the plot. I do find this confusing -- ...
2
votes
1answer
59 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 ...
0
votes
1answer
74 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
262 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
117 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 ...
5
votes
4answers
611 views

stacking negative value for ybar

I would like my ybars to be stacked the same way positively than negatively. It works for positive values but not for negative ones. On the given example, ThirdCol should be stacked negatively. Any ...
4
votes
3answers
524 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 ...
3
votes
0answers
482 views

Free space in bar-chart with empty entries

I would like to plot some data set with the ybar option of pgfplot. But not all entries are nonzero. The zero entries waste space between the bars and when the plot gets crowed it is not clear anymore ...
3
votes
1answer
123 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: ...
0
votes
1answer
89 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} ...
6
votes
1answer
280 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
111 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 ...
1
vote
2answers
87 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} ...
0
votes
1answer
38 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 ...
8
votes
1answer
151 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
83 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} ...
1
vote
0answers
22 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
110 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
117 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 ...
3
votes
1answer
516 views

Cyrillic text in symbolic x coords

I make bar plot with pgfplots: \documentclass{report} \usepackage[T2A]{fontenc} % Поддержка русских букв \usepackage[utf8]{inputenc} % Кодировка utf8 \usepackage[english, russian]{babel} % Языки: ...
4
votes
1answer
92 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 ...
0
votes
1answer
166 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, ...
2
votes
1answer
175 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 ...
1
vote
0answers
195 views

Create a bar chart from CSV

I have a .csv file that looks like this: gender.csv GENDER,NUMBER,PERCENT MALE,20,20 FEMALE,80,80 TOTAL,100,100 I want to create a bar chart using MALE and FEMALE. GENDER can be the chart name or ...
1
vote
0answers
119 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
111 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 ...
5
votes
1answer
213 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
298 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
112 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
150 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
388 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
104 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 ...
4
votes
1answer
200 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
276 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
374 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
33 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} ...
8
votes
1answer
4k views

grouped bar chart with pgfplots

I am trying to create a grouped bar chart with pgfplots, like this one: but I can't put the values over the bars, like this one: My code is: \documentclass{article} \usepackage{pgfplots} ...
5
votes
1answer
2k views

pgfplots - how to create a horizontal line plot in a bar chart with symbolic x axis labels

I was wondering if there was a way to get the line plots "Unseamed" and "Requirement" to span the whole width of the graph not just from the centre points of the first and last x axis labels. Is there ...
5
votes
1answer
694 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 ...