Questions tagged [axis]

For labels, markings, or other information, related to an axis of a graph

Filter by
Sorted by
Tagged with
1
vote
1answer
40 views

Rotate whole coordinate system

I'm kinda new in TikZ, so question may sound stupid. How can I rotate the whole coordinate system? This is what I have (simple 3D coordinate system): \begin{tikzpicture}[x=1cm, y=1cm, z=-0.6cm] % ...
0
votes
1answer
20 views

Axis and Tikz Formatting

\documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[fleqn]{amsmath} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[step = 0.4cm, gray, very thin] (-2,-2) ...
1
vote
1answer
20 views

TikZ PGFPlots Boxplots - Two labels (agree & disagree) on x axis

I want to visualise the results of a questionnaire using Boxplots. I am using TikZ with PGFPlots. I would like to label the left of the x axis with "Strongly disagree" and the right with &...
0
votes
0answers
21 views

Adding coordinate 0 on log scale in tikz

I am trying to plot a graph using tikz/pgfplot. I want the x-axis to be in log scale, I have got it using xmode=log. However, while using linear plot, the coordinate (0,0) is displayed on the graph. ...
0
votes
1answer
35 views

Can't get x coord trafo to use previously used x values

I would like to replicate an Arrhenius plot: it's a semi-log plot presenting something as a function of 1000/T (T being the temperature in Kelvin). This is not very convenient for the reader, so an ...
1
vote
1answer
23 views

How can I get scaled x ticks=false to work with xbar stacked in pgfplots?

Consider the following code: \documentclass{article} \usepackage{tikz} \usepackage{pgf} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \begin{filecontents}{test.csv} name,a,b name1,1000,1000000 name2,...
4
votes
1answer
55 views

How to transform the x-axis from second to minute?

Happy holidays everyone! A little question: I want to transform the second to minute in x-axis. Is there any solution such as add some math expressions can do it? Here is my code: \documentclass{...
1
vote
3answers
41 views

How can I add a horizontal line into a plot in case of I've changed the x-axis?

Here are my MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \pgfplotstableread{ x y error P53 0.21 0.07 IgG -0.16 0.06 cTnI 0.03 ...
1
vote
1answer
120 views

How to draw x^(2/3) as a tikxpicture

I've tried the following code, but the part with negative x doesn't get drawn \begin{subfigure}{0.4\textwidth} \begin{tikzpicture} \begin{axis} xtick=\empty,ytick=\empty, ...
1
vote
2answers
71 views

Using foreach to draw a line

I desperately need some help with the following: In this MWE I would like to draw a circle (ideally: a vertical line) at an x value coming from a foreach command. \documentclass{standalone} \...
0
votes
0answers
19 views

PGFplots 3D plot with axis lines left

I try to align the three axes of a 3D plot such that each axis start in the point (xmin, ymin, zmin): I tried axis styles=left, but in this case the y axis begins at xmax: Which is the behavior ...
0
votes
0answers
34 views

Re-label second x-axis on pgfplots

I have the following simple pgfplots with multiple ordinate axes (see below for figure and MWE). I would like to plot a second x-axis at the top that is 10 times the values shown on the bottom and ...
2
votes
0answers
25 views

Sci Tick Label Number Format same magnitude

I'm trying to plot an tikzplotlib export with large numbers on the y axis. I'd like to format them as /pgf/number format/sci, which works so far. However, I'd like the numbers to all have the same ...
1
vote
0answers
34 views

Unexplainable error message with a plot using tikz and pgfplot [closed]

I am having a problem with a plot which I am unable to explain, let alone fix. A simple example is this (there is also a curve plotted from data, but I skipped it as it doesn't affect the outcome): \...
0
votes
1answer
157 views

tikz equal axis [duplicate]

How can I get equal scaling? In the MWE I would like to have it so that the grid consists of squares. \documentclass{article} \usepackage{geometry} \geometry{textwidth=150mm, textheight=270mm} % ...
1
vote
1answer
58 views

PGF: 2 x axes without a second plot

I would like to add a second x axis to my single plot. The first x axis goes from 0 to 2, the second one goes from 0 to 0.28. 0.28 on the second axis should be on the same x coordinate as 2 on the ...
0
votes
1answer
33 views

How to label a pgfplot from top to bottom?

I just started using pgfplots for diagramms in my paper. I am using a double column layout and want to create the diagramms with the intend that they fit in a single column if possible. I find it a ...
0
votes
1answer
49 views

Creating histogram using pgfplot and tikz

I am creating histogram graphs using pgfplots and tikz. I have used tikz for other figures, but never a graph. The code I am running is: \documentclass[oneside,12pt,openany,fleqn]{article} \...
1
vote
1answer
65 views

How to hide axis labels (except some of them) inside axis environment without disabling a grid?

Let's say you want to draw a plot: \documentclass[dvipsnames]{article} \usepackage{pgfplots} \usetikzlibrary{babel,calc,backgrounds,quotes,angles,patterns,decorations.markings,intersections,arrows,...
0
votes
1answer
54 views

How can I add a unit to the y tick labels?

I want to add '%' as a unit to the y tick labels (not for the y label) for this graph here: This is the code that i wrote for this plot: \begin{tikzpicture} \begin{axis}[ ybar, ...
2
votes
1answer
33 views

How to rotate a node so it'll be parallel to a line?

I'm trying to put a node rotated parallel to a line y = 5 + x. Obviously, I expected the angle of rotation would be 45. \documentclass[dvipsnames]{article} \usepackage{pgfplots} \usetikzlibrary{babel,...
2
votes
1answer
60 views

manual colormap plot screws with ticklabels

I want to manually create a colormap plot with pgfplots. Here's what I have so far: \documentclass{standalone} \usepackage{pgfplots,tikz} \usetikzlibrary{calc,shapes.misc,positioning} \pgfplotsset{...
1
vote
0answers
37 views

Axis lines=middle doesn't center axis in (0,0). Difference between axis lines and axis lines*

Whenever I want axis go through (0,0) axis lines=middle works fine. But \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{...
0
votes
1answer
71 views

Drawing histogram on a ruled graph sheet. Help me with this

I would like to draw this histogram (see the attached image) on a ruled graph sheet. So far, I have the MWE as follows: \documentclass[tikz,border=2mm]{standalone} \usepackage{pgfplots} \pgfplotsset{...
2
votes
1answer
81 views

How to draw a linear axis with different labels and references

In line with my previous question How to draw a linear axis with tick labels at different alternative distances?, which was answered successfully by @user30471, now I need to make a variation based on ...
2
votes
2answers
96 views

Plot of function composition by coordinates

I'm try to plot the function $2^f(x)$ where $f(x)$ is a piecewise function. $f$ is given by a set of coordinates, i.e: \addplot[blue,line width=1pt,rounded corners=1pt] coordinates { (-6,4) (-2,0) (-1,...
-1
votes
1answer
121 views

Best way to draw graphs of functions for students [closed]

My question is more like ask for a common advice from more skilled people. Let's say you write a manual covering some math or physics topics. You know TeX quite well, you can write complicated ...
0
votes
1answer
30 views

Dashed line as a mark in pgfplots

I am trying to turn some markers into a dashed line in this diagram. However, I can only change them all at once. I need the "a", "b" and "c" to remain as a solid line, ...
1
vote
0answers
34 views

Undefined control sequence for tikzpicture bar plot [closed]

I am getting Undefined control sequence. error for the following tikzpicture code. it's generated at \end{axis}. I have checked the code multiple times but coundn't figure out the error. Please note ...
0
votes
0answers
27 views

pgfplot with multiple y axis stacked on top of each other

Hodgkin and Huxley have produced this plot in their 1952 paper How would we reproduce such axis position and scaling in pgfplots ?
0
votes
0answers
17 views

Error in graphs when passing to pdf

I am plotting 3 graphs in a column and I find that when I pass the doc to PDF the three graphs lose the right axis... Could you help me? \begin{subfigure}%{0.5\linewidth} \begin{adjustbox}{width=0.5\...
0
votes
1answer
96 views

matlab2tikz - problem with german letters - ä, ö, ü, \cdot and r_N

I'm using matlab2tikz the first time and get some problems with the first graph. I could seperate the problem. In the moment, I insert german letters like ä, ö, ü or special code like \cdot and r_N in ...
1
vote
0answers
28 views

Adding a letter to the x-axis ticks of pgfplots graph of function [duplicate]

I'm new to stack exchange, so please let me know if there is anything I should do to make my question more clear. I'm new to LaTeX, and I am trying to make a graph of the equation from special ...
0
votes
1answer
42 views

Drawing a second and third x-axis with tikz

This is what I want to draw: Until now I have, with help of Diagramming Unit Circle and Sine Wave with TikZ the following code: \documentclass[a4paper]{article}% guessing (cfr) \usepackage[landscape,...
0
votes
2answers
65 views

pgfplots: 2D contour plot of 3D function: placement of axes labels

I'm using pgfplots \addplot3 to plot contour plots of two-variable functions, as seen in the (x,y) plane (using view={0}{90}). However the default placement of the axes labels is odd (I suspect, ...
0
votes
1answer
56 views

How to draw a linear axis with tick labels at different alternative distances?

I need help to draw a linear axis that have a ticks labels below of axis in progresive diferent distance one from the other like a stair. I try draw this using tikz package, but I don't know do that. ...
0
votes
1answer
54 views

interval of the horizontal axis

I want to add a custom interval to the x-axis for the graph attached.It should be start from 20, and then increased by 5. For example, 20, 25, 30, ......50. Similar question was asked before, but it ...
0
votes
0answers
30 views

Using arithmetics on macros in pgf-axis-environment to specify x-ticks with TeXLive2016

The Problem: I want to compile the figure below with TeXLive2016 compatibility. I know this is kind of outdated, but apparently it is used by arxiv. The MWE compiles with TeXLive2019, but not when I ...
0
votes
0answers
28 views

How can I set the Y-asis to auto. if I don't know the range of my data?

I have a .dat file which I want to fetch the median data points to plot my figure. However the y-axis is giving issues. here is my code. and attached is the data file. \documentclass{article} \...
0
votes
1answer
45 views

Curves extends beyond the axis limits when plotting on added layers

I have encountered some problem while I was trying to change curves displaying order and at the same time maintaining the legend entries order. The curves order was changed as expected, however, they ...
0
votes
1answer
42 views

Axis label position in pgfplots using axis description cs

In the following example the x axis label and the node have the same coordinates in the axis description cs. Why are they placed at different positions? How does the label positioning work exactly? \...
1
vote
3answers
42 views

pgfplot: y axis line style and y dir conflict

There seems to be a conflict between y axis line style and y dir : in fact, although I have specified the y axis style, it still remain with the arrow pointing down My MWE \documentclass[12pt]{article}...
2
votes
1answer
28 views

Reading `xticklabels` from file: comma's do not split

The following is a MWE of a plot reading the xticklabels from a file. It works, but the comma's inside the string that is fetched from the file, don't split the string into multiple parts. How do we ...
3
votes
1answer
78 views

Error bars change marker position

For my scatter plot I have two y-axis, but they are proportional, meaning the left values are divided by a constant. Therefore, all the circles and stars are at the same position. When enabling the ...
5
votes
0answers
97 views

Shift scatter plot according to class

I have a scatter plot with many points at the same coordinate. I would like to shift every point belonging to one class a bit on the x-axis, so that they are more easily distinguishable. I've tried to ...
1
vote
1answer
67 views

Coloring cartesian axes differently [closed]

Starting from this question, How to can I make a code of tikzpicture to plot the graph of $\sin x$ as shown in figure?, and considering the same image, it is possible to see that there are different ...
2
votes
1answer
35 views

tikzpicture x ticks are aligned on the side

I want my x-ticks to be aligned below the x-axes. But as it is right now, the ticks are overlapping with the x axes. All examples I've found online don't specifiy the position of the x labels but they ...
3
votes
1answer
81 views

Labeling x-axis with pi/4, pi/2,

I'm trying to create a rectangular graph using some variation of Tikz such that I count by pi/4 on the x-axis. I can mostly get it; however, I want the labels to be in exact form (i.e., fractions, ...
0
votes
1answer
52 views

Incorrect bar graph formatting in TeX

For some reason, two very simple Bar graphs look very different after compiling in tex. More precisely, on the right graph there is a distance from the columns to the lower border of the square. In ...
1
vote
1answer
34 views

pgfplots equivalent to matplotlibs Secondary Axis

I am looking for a pgfplots equivalent to matplotlibs Secondary Axes https://matplotlib.org/3.1.0/gallery/subplots_axes_and_figures/secondary_axis.html

1
2 3 4 5 6