Tag Info

Hot answers tagged

8

Here is how you can do this with tikz as well as with pgfplots (which is what I would recommend you use): Notes: You have to be careful about division by zero, especially with tikz. With pgfplots there are ways to handle such cases more elegantly. So, I have changed the domain slightly below to avoid this problem. I'd recommend using an extra pair of ...


4

More natural expression is possible in PSTricks. So, we can use x^2 instead of (\x)*(\x). Some keystrokes get saved. \documentclass[pstricks,border=30pt,12pt]{standalone} \usepackage{pst-plot} \begin{document} \begin{psgraph}[algebraic,Dy=25]{->}(0,0)(7,110){8cm}{6cm} \psplot[linecolor=blue,plotpoints=150]{.1}{6}{1/x^2} \end{psgraph} \end{document} ...


4

pgfplots can adjust the distance between the tick labels as the width/height of the varies. Hence you can change the width (or height) of the plot by passing width = <dimen> to the axis options: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ width=15cm, %% ...


4

I assume you don't need individual captions for these. If you remove the paragraph break (the empty line) between the two they are placed on the same line. The vertical alignment is a bit off, because the bottom of the tikzpicture is placed on the current line, and so is the middle of the tabular. While the vertical 'anchoring' of the tabular can be ...


4

You can plot the connections.dat file using the scatter plot style and a couple of visualization depends on statements: \documentclass{standalone} \usepackage{pgfplots} \begin{filecontents}{testoutput.txt} xs ys qs 155 725 d 195 1215 c 1095 825 c 245 2665 b 395 2850 d 1670 2875 t 15 2660 t 270 1960 t 1715 3010 t 1085 1110 t 1040 685 t 1985 1535 t ...


4

Put shaded area on background layer: \documentclass{standalone} \usepackage{pgfplots} \pgfdeclarelayer{background}% determine background layer \pgfsetlayers{background,main}% order of layers \begin{document} \begin{tikzpicture} \begin{loglogaxis}[domain=1:100,xmin=1,xmax=100,ymin=1,ymax=100,grid] \begin{pgfonlayer}{background} \fill[color=black!10] ...


3

One way to accomplish this is to combine the techniques from pgfplots: Placing node on a specific x-position and Converting unit to coordinate works for x-coordinate, but not for y-coordinate for first placing coordinates at the specified y position and then calculating the difference: \documentclass{standalone} % include pgfplots \usepackage{pgfplots} ...


3

Instead of drawing the frame using \addplot, you can create a TikZ path which describes the same shape using the plot and --plot operations. This allows you to use the clip key to restrict all drawing inside the current scope to the area described by the path. In order to use the TikZ plot operation with PGFPlots coordinates, you need to use the axis cs ...


2

Don't use \tikzpicture...\endtikzpicture. It's just trouble. For tick labels you can use xtick={-10,...,10} to be added to the option list and same applies to y axis too. More is in the manual search for Section 4.15 Tick Options.


2

This seems like an oversight in the groupplots library. The necessary change to fix this behaviour isn't complicated (it's just a single line), but it affects a very long internal macro. To fix the library, put the following code in your preamble: \makeatletter % % Determine the ticklabels of both x and y. % \def\pgfplots@group@determine@ticklabels{% ...


2

I have figured this out, by simply using: matlab2tikz('figure2a_2.tikz', 'height', '\figureheight', 'width', '\figurewidth','extraAxisOptions','zticklabel style={/pgf/number format/fixed},ylabel style={yshift=0.9em}'); for the conversion and have \pgfplotsset{scaled z ticks=false} in the .tex file setup. Thanks.


2

Table options should go to table keyword and not to \addplot then it works \documentclass{standalone} \usepackage{pgfplots} \begin{document} \pgfplotstableread[]{ X Y Z 0.0000000e+00 3.3891017e-01 -1.3249598e-01 2.0000000e-02 3.3675858e-01 -1.3535520e-01 4.0000000e-02 3.3470984e-01 -1.3826038e-01 ...


1

A solution with PSTricks just 4 fun. \documentclass[pstricks,border=15pt,12pt]{standalone} \usepackage{pst-plot} \begin{document} \begin{psgraph}[Dx=2,Dy=2]{->}(0,0)(-10,-10)(10,10){18cm}{12cm} \psline[linecolor=blue]{*-*}(-3,3)(5,-3) \end{psgraph} \end{document}


1

Not a solution but my words on this. I also use MiKTeX 2.9 on my windows machine and updated MiKTeX 2 days ago via the MiKTeX update manager. Your MWE compiles fine for me. I added a \listfiles in the preamble of your MWE and show you the output in the log file: *File List* article.cls 2007/10/19 v1.4h Standard LaTeX document class size10.clo ...


1

Try gnuplot 5.0 rc 1 Changes in 5.0 include: * CHANGE Revised handling of NaN in input data stream I have no errors using NaN values for my contour plots with gnuplot 5.0 rc1


1

My solution with the package datatool \documentclass{standalone} \usepackage{pgfplots} \usepackage{datatool} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot[scatter, only marks, point meta=explicit symbolic, scatter/classes={ a={mark=square*,blue},% b={mark=triangle*,red},% ...



Only top voted, non community-wiki answers of a minimum length are eligible