PSTricks is a set of macros that allow the inclusion of PostScript code (e.g. drawings) directly inside (La)TeX code. This tag is compatible with the tag {diagrams}.

learn more… | top users | synonyms

4
votes
2answers
177 views

How to draw a point if the angle value and radial function are both given in algebraic (infix) form?

\documentclass[preview,border=12pt]{standalone} \usepackage{pst-plot} \psset{polarplot} \def\RPN#1{2 #1 10 div exp} \def\Infix#1{2^(#1/10)} \begin{document} ...
17
votes
4answers
595 views

What is the best way to produce TikZ picture for discrete signals?

I would like to draw discrete signals, as shown in the illustration below, but not by way of drawings of individual lines.gnuplot could be used for this work? It would be nice to be able to choose the ...
5
votes
2answers
152 views

Can we use \curvepnodes and \psnline to replace the concatenated points passed to \psrline?

Can we use \curvepnodes and \psnline to get the same result as what the following code produces? \documentclass[pstricks,border=12pt]{standalone} \usepackage{multido,pst-node} \begin{document} ...
7
votes
3answers
270 views

Improve PSTricks code for drawing of the Olympic flag

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \usepackage[locale=DE]{siunitx} \ExplSyntaxOn \cs_new_eq:NN ...
5
votes
3answers
382 views

Improvement of PSTricks code for drawing of balls in a triangular box

Consider the following. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pst-eucl} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n ...
2
votes
1answer
137 views

Improvement of PSTricks code for drawing of Pantheon

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{ auto-pst-pdf, pst-eucl, pstricks-add } \usepackage[ locale=DE ]{siunitx} ...
3
votes
1answer
119 views

Definition of PSTricks constant and improvement of code for drawing of Pantheon

Consider the following. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{ auto-pst-pdf, pst-eucl, pstricks-add } \usepackage{siunitx} \begin{document} ...
2
votes
2answers
198 views

Definition of PSTricks constant (again) and improvement of code

Consider the following example. (This is either the last one or the second to last.) Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} ...
9
votes
3answers
385 views

Improve PSTricks code for drawing of a general, regular polygon

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pst-eucl,pst-poly,pstricks-add} \usepackage[locale=DE]{siunitx} ...
12
votes
2answers
220 views

Is there another better way to have a region with gradient opacity?

My objective is to get a region with gradient opacity. In the following MWE, the region is a quarter of a disk on the top a bird. I made the gradient opacity by partitioning the sector into 45 ...
4
votes
3answers
111 views

How to define a new RPN operator with \pstVerb to convert pt to the active unit?

I want to do a vector addition with different units as follows, (1+2pt,3+4pt) % of course this point format will not work for the current PSTricks My solution is to write the point in PostScript ...
10
votes
3answers
209 views

Polar plots 1st quadrant

I'm trying to plot some polar vectors using PSTricks but I'm not able to only plot the first quadrant of a polar plot. This is my current trivial code: \begin{figure}[hbtp] ...
7
votes
4answers
151 views

add mult, etc in LaTeX

I tried to see how mult, div, add, etc work but I am unable to understand what is going on in one concrete example. Say i want to put a point at x = y = 2 but the x and y coordinate come from some ...
5
votes
2answers
107 views

How to buffer the extreme value of f(x) to draw a line representing a range of f(x)?

Please consider the following animation. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \def\f{x^2-x-6} \psset{unit=3,algebraic} \def\Atom#1{% ...
25
votes
5answers
2k views

How to draw a coffee cup

Topologists need to explain that coffee cups are homeomorphic to donuts. There are nice ways to draw donuts. So far, my best attempt is \documentclass{standalone} \usepackage{tikz} ...
6
votes
2answers
269 views

Improve PSTricks code for drawing of a football pitch

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \usepackage{siunitx} \begin{document} % Paremeters ...
11
votes
4answers
367 views

Improve PSTricks code for drawing of a chest of drawers

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \begin{document} \psset{unit=0.08cm} ...
6
votes
2answers
171 views

Optimize (or improve, at least) PSTricks code for drawing a beehive

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{ auto-pst-pdf, pst-eucl } \usepackage{siunitx} \begin{document} \begin{figure} ...
11
votes
4answers
353 views

How to improve my PSTricks code to construct a triangle diagram?

This question is similar to How to improve my PSTricks code to construct a triangle number diagram?. Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} ...
7
votes
2answers
201 views

How to improve my PSTricks code to construct a triangle number diagram?

This question is similar to How to improve my PSTricks code to construct a triangle diagram?. Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} ...
6
votes
2answers
186 views

Code improvement for PSTricks figure

Consider the following example. Code \documentclass{article} \usepackage{pstricks-add} \begin{document} \def\laengde{60 } \psset{unit=0.04} \begin{pspicture}(260,260) \pnode(0,0){P1} \pnode(!0 ...
6
votes
1answer
310 views

PSTricks and Tikz in plain TeX

I would create both pstricks and tikz picture in my plain TeX documents. If I try, I get an error, maybe caused by the use of the xcolor package. The error is the following: \\color@black ...
5
votes
2answers
173 views

Closed curve in PSTricks

Consider the following example: \documentclass{article} \usepackage{pstricks-add} \def\side{% \psline(-2,2)(-1,2) \psarc(0,2){1}{180}{0} \psline(1,2)(2,2) \psline(-1,1)(0,2)(1,1) } ...
8
votes
2answers
117 views

How to change \psaxes angle to match with data?

I'm able to draw radar chart using tex code mentioned below: \documentclass[landscape,a3paper,11pt]{article} \usepackage{pstricks-add} \usepackage{pgfplots, pgfplotstable} \begin{document} ...
9
votes
1answer
90 views

How to create PSTricks animations on the web page with interactive control panels?

I just visited a cool site that showing PSTricks animations with interactive control panels. For more details, please visit this link (click). The question is how does the owner of the site make the ...
5
votes
1answer
63 views

Why does a curve connecting a node from a column to another node in another column disappear?

I want to show items, each with a curve pointing to a point on the right figure. But in the following code, the curves disappear. What is wrong? \documentclass{beamer} \usepackage{graphicx} ...
9
votes
2answers
205 views

Riemannian step functions with pst-func

I know from the pstricks-add manual, that I can get a vizualization of upper and lower sums for the Riemannian integral like this: \documentclass{standalone} \usepackage{auto-pst-pdf} ...
42
votes
13answers
2k views

What is the simplest way to draw this triangle exactly?

I want to see how we can exactly construct the following diagram as simple as possible. It means that the manual calculation should be avoided. Note that the angle marks attached to angles ...
8
votes
6answers
445 views

How to draw a ring-like diagram with some labels on its arcs?

I would like to draw a figure that looks like the following scenario: Consider a circle of radius $r$, described parametrically by $x = cos(t) and y = sin(t)$. I'd like to draw a figure where the ...
6
votes
1answer
69 views

Does \pslistplot support option polarplot=true?

Consider the following example: \documentclass{standalone} \usepackage{pst-plot} \begin{document} \psset{unit=0.5} \begin{pspicture}(-8.5,-8.5)(14,9)% ...
6
votes
1answer
212 views

How to pass PostScript expression to nodesep and offset when using ([…]node) syntax?

Quoted from pst-news13.pdf on page 3: The labelsep is the first – optional – argument of \uput. It is now possible to use the PostScript notation for this length, eg {! 45 sin 3 mul}. Then the ...
5
votes
2answers
87 views

What is the correct RPN expression of a piecewise-defined function passed to \psplot?

My objective is to pass a piecewise-defined function in RPN to \psplot. The complete code is given as follows. The function is sin x for x<0 and cos x for other x. ...
6
votes
1answer
296 views

PSTricks: charpath on a curve (like textpath)

I am interested in drawing a specially rendered text on a curve. The LaTeX package pst-text provides a function to draw text on a curve (pstextpath) and a function to specially render text ...
23
votes
6answers
1k views

Spirograph, Continuous Rotations in TikZ or PSTricks

Spirograph-like drawings are obtained when one repeatedly draws a closed curve on a continuously rotated canvas. Is there a nice way to make spirograph drawings using TikZ or PSTricks? There is a nice ...
6
votes
1answer
152 views

PSTricks figure turned 90 degrees

Consider the following example: \documentclass{article} \usepackage{pstricks-add} \def\RPut(#1)#2{% \rput[r]{90}(!#1 1980 sub 2 div 0){#2 \quad} \rput[l]{90}(!#1 1980 sub 2 div 0){\quad #1} } ...
2
votes
1answer
73 views

Conditional assignment in a loop

Objective: I want to compile the temporary.tex file containing PSTricks code twice. One with -jobname=Rotated and the other one with -jobname=Unrotated. The resulting Rotated.ps will be passed to ...
4
votes
2answers
104 views

Bug report pst-3dplot, where should I submit it?

I discovered a bug with the auto-pst-pdf package, but don't know where to report it. The bug manifests itself both with pdflatex and the dvi->ps->pdf chain. Here is a minimal working example: ...
3
votes
2answers
134 views

pstricks compile problem

I know this issue has been discussed a lot in other topics, but most of them contain complex examples, from which I haven't been able to understand the solution. So I have the following code: ...
6
votes
1answer
286 views

Drawing vector field using PSTricks

Are there any PSTricks packages for drawing vector fields? I have had a look at http://tug.org/PSTricks/main.cgi?file=examples#vector but I don't fully understand the syntax in the example(s). Also I ...
4
votes
1answer
120 views

Why does adding one more subtree make a cropped output?

\documentclass[preview,border=12pt]{standalone} \usepackage{pst-tree} \psset{treemode=R,edge=\ncline} \def\ABCD{% \psTree{\Tcircle{A}} \psTree{\Tcircle{B}} ...
2
votes
0answers
68 views

Problem with Texlipse and auto-ps-pdf

I'm using the Eclipse-plugin Texlipse as my preferred LaTeX-editor. But since I'm using auto-pst-pdf for PStricks graphics in pdf-files Texlipse doesn't manage the complete compilation. That works ...
7
votes
1answer
140 views

How to make the arrow head still look nice for a short curved path?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-node,multido} \psset{arcangle=90,nodesep=3pt,arrows=->} \begin{document} \multido{\n=3+-.75}{4}{% \pspicture(3,3) ...
3
votes
2answers
288 views

How can I draw this diagram of my function's domain?

How can I do this? I do not know how to do this. Is it possible to do it in LaTeX or should I create a figure with GeoGebra and insert it?
9
votes
2answers
229 views

How can I encode the current document as a QR code with pst-barcode?

\documentclass{article} \usepackage{pst-barcode} \begin{document} \begin{pspicture} \psbarcode{\input{\jobname.tex}}{}{qrcode} \end{pspicture} \end{document} I tried placing \expandafters before ...
3
votes
1answer
66 views

How to change label numbers : polarplots

As per answer received in previous post, i'm able to draw graph mentioned below using tex file : \documentclass[11pt,a4paper]{article} \addtolength{\textheight}{1.1cm} ...
4
votes
1answer
113 views

PSTricks: ugly pie chart

I use pstricks to draw pie chart but when I do \documentclass{article} \usepackage[pdf]{pstricks} \usepackage{pstricks-add} \begin{document} \titlepage ...
5
votes
1answer
107 views

pst-barcode produces PS files which Ghostscript can not read

Weird problem with pst-barcode package. TeX file: \documentclass[a4paper]{minimal} \usepackage{pst-barcode} \begin{document} \begin{pspicture}(.25in,.25in) ...
6
votes
2answers
93 views

Getting “Dimension too large” using psgraph and listplot

I am trying to setup a chart. Sometimes the y-Axis Value range gets a little narrow. And in one of those cases I ran into the infamous "Dimension too large" error as seen below. How can I circumvent ...
10
votes
1answer
347 views

How to change the step of tick and label of \psgrid?

Sometimes it will be convenient to work in big integers for the coordinates. To control the physical size, we can adjust the unit for scaling. Unfortunately, changing unit to a small size will make ...
10
votes
3answers
778 views

Drawing of Sun–Earth–Moon system

Is there a package (or packages) for drawing the Sun–Earth–Moon system with either PSTricks, TikZ, or some other vector graphics language to illustrate Lunar and Solar eclipses, the phases of the ...