# Tag Info

10

\documentclass[border=10pt,pstricks]{standalone} \usepackage{pst-node,pst-plot,pst-eucl,multido} \begin{document} \multido{\iA=0+6,\iB=1+1}{60}{% \begin{pspicture}(-5.2,-5.2)(5.5,2.5) \pnode(0,0){O} \psaxes[linewidth=0.5pt]{->}(0,0)(-5,-5)(5,2)[$x$,0][$y$,90] \rput{\iA}(0,-3){\pnodes(-4,0){A}(4,0){B}\psline(A)(B)} \pnode(!\iA\space tan ...

10

For plotting those functions properly, you can use the VarStep parameter. The pstricks-add documentation even has an example for plotting sin(1/x) (Section 24.4 Sine of the inverse of x). And you must split the plot for sin(1/x) in order to skip the 0: \documentclass[pstricks, margin=5pt]{standalone} \usepackage{pstricks-add} \usepackage{pst-func} ...

9

I do not think that you get a better result with the current tools. The following uses always the same units for all functions: \documentclass[pstricks, margin=5pt]{standalone} \usepackage{pstricks-add} \begin{document} \def\xLeft{-0.5} \def\xRight{0.5} \psset{xunit=8,yunit=2} \begin{pspicture}(\xLeft,-1.2)(0.55,1.3) ...

8

use it this way: [...] \usepackage{ifpdf} \usepackage{tikz} \usepackage{pgfplots} \ifpdf\else \usepackage{pstricks,pst-node,pst-plot,pst-circ} \psset{pgffunctions} \fi \begin{document} [...] then it will work with pdflatex --shell-escape, latex->dvips->ps2pdf, and xelatex

7

You want a conditional value for the value \psframe[origin={\ix,\iy}, fillstyle=\ifodd\numexpr\ix+\iy\relax vlines\else solid\fi, hatchsep=.5pt, hatchcolor=lightgray](-1,-1) which is OK here as the hatchxxx keys are ignored in the solid case. Or you need a call to \psframe with a different number of arguments, ...

7

You can actually do this via pgfplots but to make it a little nicer you have to switch to LuaLaTeX since PDFLaTeX chokes up on memory limitations (due to many samples per axis. You don't need that much but why not :P). \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \begin{axis}[y domain=-4:4, ...

7

7

Here's a more direct translation of Herbert Voss's torus with a slinky wrapped around it. First, some boilerplate: settings.outformat = "png"; settings.render=16; size(13cm,0); import graph3; The first line is, I think, reasonably clear. A png file is used rather than a vector format because, currently, Asymptote produces better 3d graphics when they ...

7

Run with xelatex \documentclass[a4paper]{article} \pagestyle{empty} \usepackage{pstricks-add} \begin{document} \def\arraystretch{1.7} \begin{tabular}{@{} c @{\hspace{1.5cm}} c @{}} \bfseries\itshape Sexe & \bfseries\itshape Types d'\'etudes \\ & \rnode{l}{Litt.} \\ \rnode{f}{F} ...

6

This is one possible solution where myarrow style is defined for arrow decoration at position=0.7. One may use bend left/right=xx, xx=some angles of choices. Code \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{decorations.markings,arrows,positioning} \tikzset{myarrow/.style={decoration={markings, ...

6

Your inv definition didn't appear to be in scope so I just inlined a similar definition \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \pstVerb{/inv {dup 0 eq {pop e30} {1 exch div} ifelse} bind def} \begin{document} \begin{pspicture}(-3,-3)(5,5) \psaxes{->}(0,0)(-3,-3)(5,5) \psplot[linecolor=blue,linewidth=2pt]{-1}{4} {1 1 x 0 ...

6

\documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}% \usepackage{lmodern} \usepackage[nomarginpar, textwidth = 16cm]{geometry} \usepackage[svgnames,x11names]{pstricks}%%, pdf \usepackage{pstricks-add} \usepackage{multido} \usepackage{mathtools} \pagestyle{empty} \begin{document} \psset{nodesep=2pt} ...

6

It's better to use alpha-numeric names. The following inserts two extra nodes at a distance of 15pt (nodesep=15pt) to the right of node F (horizontally), one on the same level as node B and the other at the same level as node F (vertically). Then, the two arrows are drawn, followed by the placement of the labels using a [l]eft reference point. ...

5

Changing the units (unit itself and linewidth) does resize the image: \documentclass{article} \usepackage[pdf]{pstricks} \newpsobject{pslineA}{psline}{linewidth=6\pslinewidth, linecolor=green} \newpsobject{pslineB}{psline}{linewidth=10\pslinewidth, linecolor=red} \begin{document} \begin{pspicture}(5,5) \psline(0,1)(5,1) ...

5

every macro which is declared as a PSTricks object like \def\xyz{\pst@object{xyz}} \def\xyz@i{% ...% } will kill all preceding glue. \pstVerb is not a PSTricks object or in short: it is a normal TeX macro and \psframe is such an object. A shorter version: \documentclass[pstricks,border=24pt]{standalone} \usepackage{multido} \begin{document} ...

5

This seems to be a issue more about xkeyval than auto-pst-pdf: when you type the option as pdfcrop = {--hires} for some reasons the program gets called as pdfcrop hires--hires "<filename>-autopp.pdf" "<filename>-pics.pdf" which is incorrect. If braces are omitted pdfcrop = --hires or the space following = is omitted pdfcrop ={--hires} ...

5

I think what you are asking for it is precisely in ePiX's, (http://bay.uchicago.edu/tex-archive/graphics/epix/samples/butterfly.xp) examples. If I understand the code, the strategy is to draw the surface in three patches. It would be fun to translate this into pgfplots and asymptote. Maybe asymptote can even define this curve implicitly (it is very good at ...

5

You could use TikZ and its decorations.markings library. Please see Section 48.5, page 592+, in the TikZ3 manual, http://ftp.cvut.cz/tex-archive/graphics/pgf/base/doc/pgfmanual.pdf. I enclose an example of this approach with help of the postaction option. \documentclass[a4paper]{article} \pagestyle{empty} \usepackage{tikz} ...

5

It is impossible to draw these curves because they oscillate infinitely to zero (in fact, they are the typical examples of continuous and differentiable functions that you can not draw). The best we can get is a graph in a range that does not contain zero. Spivak's pictures show very good the behavior of the functions, but they are not accurate graphs. In ...

5

That is a simple solid filling with a small value for opacity: [...] \psset{unit = 2.4,opacity=0.2,fillstyle=solid} \begin{pspicture}(-3.5,-1.75)(3.5,4.25) \psellipse[rot=-50,fillcolor=blue](1.5,0.5)(1.5,3) \psellipse[rot = 50,fillcolor=red](-1.5,0.5)(1.5,3) \psellipse[rot = -50,fillcolor=green](0,1.8)(1.5,3) \psellipse[rot = ...

4

It's 1 1 x div floor div. I don't know if the floorfunction is defined for algebraic notation in pstricks. Here is a code to plot this function with pstricks to be compiled with pdflatex; due to the infinite discontinuity in 0, you have to plot the two parts of the curve separately: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} ...

4

One can pre-compute the coordinates using or one can use Tikz and \whereami to get the coordinates \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{intersections} \makeatletter \newlength{\whereamix} \newlength{\whereamiy} \newcommand{\whereami}[2]{ % #1 = anchor name, #2 = color \draw[color=#2] (#1) node{ ...

4

The dashes and the points in the names of the save node coordinates make problems with the AlgParser and are misinterpreted. A node name N-A.x becomes N A x exp sub. So you must redefine N-A.x and N-B.x before you can use them in an algebraic expression: \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-eucl,pstricks-add} ...

4

Somewhat crudely done with MetaPost. Coding can certainly be optimized. EDIT I've improved the coding (I think). The result remains the same, except for the filled dots which are now really of the same size than the empty ones. input latexmp; setupLaTeXMP(textextlabel=enable, mode=rerun); vardef dot expr z = image(filldraw fullcircle scaled 3bp shifted ...

4

When the following statement is expanded by TeX \psSolid[object=point,args=0 \b \a, name=A, text=B, pos=uc] the args= will be seen in PostScript as args=0 22 the space after \b is gobbled by TeX. It is the same as in \TeX forever. Use \psSolid[object=point,args=0 \b\space \a, name=A, text=B, pos=uc] In your second example The definition args=O A ...

4

Asymptote vs Sage I am submitting an example created in Asymptote which is and isn't working (a bug?), let me hope it won't offend someone. I had an opportunity to compare Asymptote and Sage (neither TikZ nor PSTricks this time, I'm sorry), I would like to share my modest experience anyway. A story But before that, if you are begging so nicely, I ...

4

Here's the definition of rtp2xyz in Postscript (from pst-solides3d.pro): %%%%% ### trigospherique ### %% passage spherique --> cartesiennes %% les formules de passage ont été récupérées ici : %% http://fr.wikipedia.org/wiki/Coordonn%C3%A9es_polaires %% syntaxe : r theta phi rtp2xyz -> x y z /rtp2xyz { 6 dict begin /phi exch def /theta exch ...

4

\documentclass[pstricks]{standalone} \usepackage{pst-solides3d} \begin{document} \begin{pspicture}(-4,-6)(5,9) \psset{viewpoint=100 30 40 rtp2xyz,lightsrc=viewpoint, Decran=120} \psSurface[ngrid=.15 .15,incolor=yellow,hue=0 1,linewidth=0.1\pslinewidth, algebraic,axesboxed](-1,-2)(1,2){ 4*x^3 - 2*y*x} \end{pspicture} \end{document} The z max/min ...

4

Use always relative coordinates: \documentclass{article} \usepackage{pst-node} \pagestyle{empty} \begin{document} \psset{nodesep=2pt} \begin{psmatrix}[mnode=r,colsep=0.6,rowsep=0.75] & &[name=1] $D_5$ & \\ & &[name=2] $\{e,a,a^2,a^3,a^4\}$ ...

3

Asymptote can plot an implicitly defined surface if you insist on doing it that way: settings.outformat = "png"; settings.render = 16; size(8cm); import contour3; currentprojection=perspective(3*(4,-6,3)); real f(real v, real u, real x) { return 4x^3 + 2u*x + v; } draw(surface(contour3(f, (-2,-2,-2), (2,2,2), nx=40)), ...

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