Questions tagged [nodes-near-coords]

A (scatter) plot style for pgfplots which places text nodes near every coordinate.

Filter by
Sorted by
Tagged with
30 votes
1 answer
24k views

pgfplots bar plot: spacing inbetween bars

How can I increase the spacing between the bars in a bar plot from pgfplots? \documentclass{minimal} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{...
MartinG's user avatar
  • 303
20 votes
2 answers
3k views

How to minimize the ink-to-data ratio for pgfplots

Tufte advocates to "minimize the ink-to-data ratio" for charts. I am trying to style a multi data series bar chart, that can have a grid and axes as shown below (chart at the left is from the ...
yannisl's user avatar
  • 117k
20 votes
2 answers
10k views

Is is possible to rotate text using nodes near coords?

I'm plotting a ybar, and nodes near coords is ugly. Is it possible to rotate the text above the bars by 90? \begin{tikzpicture} \begin{axis}[area legend, legend pos=north west, legend columns=4, ...
Iain's user avatar
  • 303
17 votes
2 answers
3k views

Naming the nodes of `nodes near coords` for later use

I would like to use pgfplots command nodes near coords to get a list of named node ((no1), (no2), (no3) etc.) that I can use afterwards to draw some paths that I fail to construct with pgfplots only. ...
M. Toya's user avatar
  • 3,227
16 votes
2 answers
12k views

How to mark/label nth data point from file in pgfplots?

\documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.10} \pgfplotstableread{ 0.01 1.00 0.02 2.00 0.03 3.00 0.04 4.00 0.05 5.00 }\datatable ...
Hotschke's user avatar
  • 5,310
12 votes
2 answers
7k views

Center nodes near coords in a stacked ybar plot

I'm trying to center the node values, at the middle of each bar, in a stacked plot. However I can only put those nodes in the top of each bar. Is it possible to move those down? To the center of each ...
adn's user avatar
  • 11.2k
12 votes
1 answer
2k views

nodes near coords with logarithmic axis: Wrong values

I created a horizontal bar plot to compare benchmark times. Since one of the tested components is really slow, I need a logarithmic y axis for the other values to be distinguishable. Combined with "...
Daniel B's user avatar
  • 223
12 votes
2 answers
4k views

Nodes near coord overlapping...how to shift up

I am using nodes near coords but as you can see the values on the bottom are overlapping. I have tried placing them manually but that hasn't worked either...How to just shift up the nodes so they do ...
guestpost's user avatar
  • 121
11 votes
1 answer
3k views

pgfplots how to nicely place nodes

The picture produced by code blow, there are two problems I have. (1) the number above point overlapped (2) the precision of number is not right, eg. I want 0.913, not 0.91 For the first problem I ...
icycandy's user avatar
  • 493
9 votes
2 answers
6k views

pgfplots - barplot with multiple bars on same coordinate, but labelled differently

I'm showing several data sets next to each other using multiple \addplot commands within a pgfplots axis environment. These are then further grouped into categories. The output of the graph per se is ...
Vertho's user avatar
  • 303
9 votes
2 answers
2k views

how can I change the exponential value to decimal?

I want to make my plot completely in decimal. I used the function \pgfkeys{ /pgf/number format/precision=1, /pgf/number format/fixed zerofill=true } to make my decimal like 2.0 instead of ...
Rizwan's user avatar
  • 143
9 votes
1 answer
2k views

pgfplots: percentage in matrix plot

I'm trying to draw a matrix plot with the shown values in percentage. I already tried: nodes near coords = {\pgfmathprintnumber\pgfplotspointmeta\%} Unfortunately this didn't work out. Here is my ...
Gustav's user avatar
  • 93
8 votes
2 answers
6k views

pgfplots legend order

The following code draws a bar chart with number labels. I want the entries in the legend to be the other way around i.e. for there to be a gray box at the top with the label "two", and a white box ...
Gareth Walker's user avatar
8 votes
2 answers
1k views

Adding units to pgfplots nodes in column chart

The picture below is almost what I need and is generated by the MWE below. All I require is to include percentage symbols on the labels on the nodes. So they should read: 34%, 22% and 13%. -----------...
Geoff's user avatar
  • 2,637
8 votes
1 answer
2k views

Add colored circle around specific points in pgfplots

I wanted to add some transparent circles around specific points in my pgfplot like this: here is what I have so far: \documentclass{article} \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest} \...
Joe's user avatar
  • 9,080
8 votes
1 answer
3k views

pgfplots: nodes near coords only for one plot

Does anyone know how to set up pgfplots to print nodes only for one and not for all plots? For example, in 1 I would like to see the nodes only for the test-plot and not for the trend-plot. You will ...
MaKa TaBo's user avatar
  • 437
8 votes
1 answer
2k views

pgfplots: Set exponent of scientific number format for nodes near coords

As you can see, my plot currently has node labels with scale factors of both 10^6 and 10^5: My goal is to specify a scale factor of 10^6 for every node label: So my question is: How can I explicitly ...
user avatar
8 votes
2 answers
257 views

pgfplots: node near coords missing due to rounding problems

I have the problem that in the following plot the right node near coords text of A is missing. The source of the problem is a rounding error in the data: They should sum up to 100 but in A it is a bit ...
Ulrike Fischer's user avatar
7 votes
1 answer
4k views

pgfplots: Positioning "node near coord" at the bottom of the bar

I would like to position nodes near coords at the bottom of the corresponding bar, right by the X axis. Here's what I've got now: \documentclass{report} \usepackage{pgfplots} \begin{document} \begin{...
wxd's user avatar
  • 133
6 votes
1 answer
1k views

pgfplots: percentages and endvalues in stacked ybar

I have two questions regarding the pgfplots package. I have attached the source code I worked on. There are two features I am not able to realize: I would like to put the total value (sum of the ...
Josef Dragber's user avatar
6 votes
1 answer
110 views

Problem with foreach loop in tikzpicture - undefined control sequence

I am puzzled by something in tikzpicture. Here is the problematic code that i shrinked to its minimum: \documentclass{article} \usepackage{tikz} \usepackage{xcolor} \usepackage{pgfplotstable} \...
Etienne's user avatar
  • 115
5 votes
1 answer
1k views

Nodes Near coords hide when 0

Is it possible to hide nodes near coords in pgfplots when value = 0 ? I have something like this. And axis setting \begin{axis}[ ybar, bar width=3pt, nodes near coords ]
RusAlex's user avatar
  • 235
5 votes
1 answer
14k 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!). ...
Fernando César's user avatar
5 votes
1 answer
2k views

pgfplots - How can I use 'nodes near coords' with multiple data values for one tick?

When using displaying multiple values for a tick and then activating the display of the values/coordinates, things get messy. This is why I want to display the values inside of the bar. Or on the ...
henry's user avatar
  • 6,594
5 votes
2 answers
190 views

How to make lines joining point a target - tikzpicture

I have been able to do the code below but it is still not what I need. I need points a1 through a5 to form a straight line to the point "Gol". How do I do that? The .dat files look like this (...
Marcos Laureano's user avatar
5 votes
1 answer
1k views

using bar chart to compare two groups of data, how to draw one node (showing the ratio) per two bars?

I have two groups of data, you can think of them as one control group and one treatment group, and each data point shows the system's performance under certain parameter x. Now for each value of ...
user33242's user avatar
4 votes
3 answers
894 views

How to show a "node near coord" even when it is out of bounds (with clip = true)?

I have a ybar graph using the pgfplots package in which I use nodes near coords to display y values near the tops of the bars. There are some outliers in the data, for which I'd like to show a bar ...
Keelan's user avatar
  • 5,425
4 votes
2 answers
1k views

Pgfplots: shift single nodes with nodes near coords

I use the following code. Is there a way to shift specific nodes of "nodes near coords" without placing every node itself which is a lot of work? The nodes at "Fichte" and "Kiefer" are overlapping ...
Felix Phl's user avatar
  • 285
4 votes
1 answer
2k views

pgfplots: "nodes near coords" on xbar chart is off

I am trying to make an xbar chart using pgfplots, and I'd like to add the bar's value to the bar. Simply using "nodes near coords" positions the value for a ybar chart, which isn't correct here. What'...
erjiang's user avatar
  • 397
4 votes
1 answer
799 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 ...
Rico's user avatar
  • 6,097
4 votes
1 answer
1k views

Remove duplicate labels with symbolic y coords [duplicate]

I am new to pgfplots and have a problem with the following example: \begin{tikzpicture} \begin{axis}[title = Some fancy benchmark data, xbar, y axis line style = { opacity = 0 }, axis ...
Josef's user avatar
  • 143
4 votes
2 answers
1k views

Tikz stacked bars plot - change labels

I have the following bar plot. The code for this is: \documentclass{standalone} \usepackage[x11names]{xcolor} \usepackage{tikz,pgfplots} \usepackage{graphicx} \usepackage{ifthen} \usetikzlibrary{...
Soraltan's user avatar
  • 105
3 votes
2 answers
204 views

Partition Triangle

I am working on a paper on integer partitions and I want to add something like this. This is not my picture, it is from another paper, but is it possible to do this on LaTex? I want to be able to ...
Lewis's user avatar
  • 85
3 votes
3 answers
1k 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 ...
Fabian Jäger's user avatar
3 votes
2 answers
710 views

nodes near coords from table

I want to add a non-numerical value as a node on a histogram. The labels come from a column in a table, fairly similar to this other question, i.e. using value \thisrow{<column>} as <macro>...
caverac's user avatar
  • 7,931
3 votes
1 answer
3k views

Text nodes for nodes near coords

I'd like to have the customized text node labels for nodes near coords, For example, instead of the numbers (7,10,15 ...) on the right side of each bar, I'd like to have some text. \documentclass{...
user200340's user avatar
3 votes
2 answers
3k views

Plotting the sum of a function in TikZ

I am trying to plot a function that is the sum of another function based on the parameter. A famous example of this is the "sum of squares", however the functions I really want to do this do not have ...
kap's user avatar
  • 407
3 votes
1 answer
3k views

How to specify number of decimal places in node near coords?

Is there a way to specify that node near coords labels should use 1 rather than 2 decimal places? For example, in the code below, Singapore is printed with 8.1 (correct), but Niger is printed with 46....
I Like to Code's user avatar
3 votes
1 answer
1k views

pgfplots, xbar stacked: Prevent overlapping by shifting only one node

The following example results in two overlapping nodes (column 4 and 5 in row 0): \documentclass{standalone} \usepackage{pgfplots,pgfplotstable} \pgfplotsset{% ,xmin=0% ,/tikz/font=\...
typokurz's user avatar
  • 1,047
3 votes
1 answer
519 views

Creating a tornado plot with PGFPlots 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 ...
jon86's user avatar
  • 431
3 votes
1 answer
2k views

style odd and even nodes near coords differently

I'm using this style definition in the preamble: \pgfplotsset{ base/.style={ ymin=0, xtick=data, nodes near coords, } } \pgfplotsset{ random/.style={ ybar=3pt, bar width=...
Martí Bosch's user avatar
3 votes
2 answers
2k views

PGFplots: Changing style of labels of nodes near coords

Trying to adopt this answer approach, I didn't manage to get what I want of changing the style of the nodes near coords labels. I would like to make this code poles={red, fill = blue, draw} work and ...
Diaa's user avatar
  • 9,599
3 votes
2 answers
3k views

PGFPlots scatter graph point meta

I want to draw a 3D graph that uses point meta = explicit symbolic for the nodes near coord, and I also want to use meta = explicit symbolic (or something similar) for coloring the blocks in function ...
Philip Gaudreau's user avatar
3 votes
1 answer
1k views

Segmented bar chart under tikz plot

I'm trying to create a segmented bar chart (stacked bar chart) under my tikz plot: For each point, I want to make a segmented bar chart directly below the point. The segmented bar chart for each ...
warship's user avatar
  • 1,078
3 votes
1 answer
3k views

Mark nodes/coordinates by label (PGFPlots)

I am drawing a scatterplot, where the data is in a table and the values are labeled. I want to connect certain nodes with straight lines and in order to do so, one has to label the nodes/coordinates. ...
alesc's user avatar
  • 761
3 votes
1 answer
85 views

Change color of nodes near coords based on value

I have this matrix plot: \documentclass[tikz]{standalone} \usepackage{pgfplots, filecontents} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false] \addplot [ matrix plot, nodes near ...
ValenStein's user avatar
3 votes
2 answers
793 views

pgfplots: How to hide "nodes near coords" if value is 0 (empty)?

Assumed we have this Minimum Working Example (MWE): \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, ...
Dave's user avatar
  • 3,758
3 votes
3 answers
1k views

How to remove arrow from the Pgfplot pin option?

I was wondering how to remove arrow from pgfplots pin option. I do not want any line and want only text. Many Thanks in advance! Edit: Added MWE: I would like to remove the two arrows but want to ...
Tasnuva's user avatar
  • 93
3 votes
2 answers
7k views

pgfplot/tikz stacked bar chart, with compat=1.9 or later

Inspired by this question, pgfplot/tikz stacked bar chart, I've been trying to create a stacked bar chart with numbers at the end of the stacked bars. However, the location of nodes near coords was ...
golvok's user avatar
  • 175
3 votes
1 answer
390 views

Make text color value dependent in matrixplot

I'm trying to tweak this plot: pgfplots: percentage in matrix plot ... to have the annotations change color depending on the value. Above 50% should be white and below should be black. I have a ...
Thomas's user avatar
  • 35