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
1answer
86 views

How to use PostScript for to plot the sum of cos(n*x) for n=0 to n=100?

I want to plot the function f(x) which is the sum of cos(n*x) for n=0 to n=100. The domain is from 0 to 2π. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \begin{document} ...
3
votes
1answer
64 views

Removing unwanted lines and iterative plot

I am trying to plot a couple of streamlines over a circle, defined as x^2 + y^2 - 4, so the radius is 2. I am trying plot using a function, specifically using PSTricks. However, I keep getting extra ...
5
votes
1answer
104 views

How can I write accented letter “ő” in PSTricks?

I'd like to write accented (hungarian) letters in PSTricks. With the solution below I can write "é", "á" and other similar characters but this doesn't work for "ő". Here is what I tried: ...
4
votes
1answer
54 views

How do I ignore lines to points with y=0 using pst-plot and a logarithmic y-scale?

I am using pst-plot to visualize data sets in linear x and logarithmic y scale. The data set should be plotted by connecting all points with a solid line style. This all works fine by using ...
4
votes
1answer
138 views

Cabinet projection in PSTricks (2)

I'd like to draw 3D-objects in cabinet projection with angle α=26.565° (i.e. atan(α) = 0.5) and scaling factor k=0.5590 = sqrt(5)/4, because the objects should be drawn on a grid, as in the left ...
5
votes
1answer
282 views

Drawing torus points and arches with coordinates read from a file

I have a quite intricate question... I have to plot a torus of radii (r,R) with two set of points of different colour on it its surface. The points' coordinates are in two different files that must be ...
12
votes
2answers
124 views

What is PostScript dictionary for? How to know whether or not I need it?

Consider the following code, \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \psset{linecolor=red} \pstVerb { /updateCP {2 copy CPy add /CPy ED CPx add /CPx ED} bind ...
7
votes
2answers
137 views

What causes two identical instances to produce different result?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \pstVerb { /updateCP {2 copy CPy add /CPy ED CPx add /CPx ED} bind def /updateA {1 sub sqrt 1 exch atan Angles add ...
3
votes
2answers
59 views

Moving the common angle to \pstVerb produces incorrect result

Consider the following complete code first. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}(-5,-5)(5,5) \def\points{(0,0)(1,0)}% ...
5
votes
2answers
138 views

Is it possible to exit from the PostScript expression and abort the drawing?

I just want to draw a dot if the condition is satisfied and otherwise cancel the drawing of the single dot. The following code is the simplified version of my real scenario. Please don't suggest other ...
2
votes
2answers
136 views

How to change the label color of \psaxes?

\documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-plot} \begin{document} \begin{pspicture}(-5,-1)(5.5,5.5) ...
5
votes
1answer
104 views

How to draw a line from the origin to the last point of \psrline?

Consider the following code to draw the Theodorus' spiral. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) ...
3
votes
1answer
75 views

How to use \psVector as a replacement for \rlineto in drawing Theodorus' spiral?

Consider the following minimal working example. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) ...
2
votes
1answer
55 views

How to separately access the abscissa and ordinate of the current point?

Consider the following code. \documentclass[pstricks,border=12pt]{standalone} \SpecialCoor \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) \pscustom { \psline(1,0) ...
1
vote
1answer
77 views

How to cancel the effect of \translate when I want to draw a radial line from the untranslated origin to the current point?

Consider the following MWE first. \documentclass[pstricks,border=12pt]{standalone} \SpecialCoor \usepackage{multido} \begin{document} % draw the tangential lines ...
5
votes
1answer
64 views

Problem Creating a Polar Grid using PSTricks

I am a MacTeX 2013 user that uses PDFLaTeX to create my files. After a recent update, the following code stopped producing a polar grid. I checked the documentation for any changes as well as the ...
40
votes
9answers
2k views

The Spiral of Roots in TikZ

How can one create a spiral of roots as shown in the diagram below: where one can use a command to draw more parts to the spiral. For example, a command like \sqrtspiral{1}, \sqrtspiral{2}, ...
2
votes
1answer
146 views

high resolution table of numbers

I'd like to design a table of numbers for poster-size printing, say like a multiplication table, so I'm looking for: high resolution, colors, pretty fonts. Does it sound like it could be done in ...
10
votes
3answers
1k views

Define a “square” command

I try to define the following command, for drawing a square in pstricks: \newcommand{\square}[4] { \rput(#1,#2){\psframe[linecolor=#4](0,0)(#3,#3)} } I use it like this (for drawing a red square ...
6
votes
1answer
132 views

What transformation do I have to apply to a node before passing it to \uput as a direction angle?

Consider the following code \documentclass[pstricks,12pt]{standalone} \usepackage{pst-node} \usepackage{pgfmath}% don't forget this line! \psset{saveNodeCoors} \degrees[13] \begin{document} ...
5
votes
1answer
58 views

What makes the looping index in \foreach produce compile-time error?

Consider the following code and error message. \documentclass[pstricks,12pt]{standalone} \usepackage{pst-node} \psset{saveNodeCoors} \degrees[13] \begin{document} \makeatletter ...
7
votes
2answers
419 views

Projection of included 2D graphics to a plane

General purpose I want to project a graphic file from external sources (example.pdf saved on my computer e.g. a chip design) on the bottom of a 3D graphic (which I can draw in LaTeX by using TikZ, ...
6
votes
2answers
115 views

Problems to get two graphics in different pages with standalone

In the following MWE I get a single page with the two graphics within: \documentclass[multi]{standalone} \standaloneenv{pspicture} \usepackage[dvipsnames, svgnames, prologue]{xcolor} ...
1
vote
1answer
69 views

Clash between animate and hyperref on pdfLaTeX

When I compile the MWE below on pdfLaTeX I get the error message `! pdfTeX error (ext4): destinations cannot be inside an XForm. right before the \newframe* command is read. I have tried by switching ...
3
votes
2answers
88 views

Problem with animate package and PSTricks

For some reason I haven't been able to discern yet, the code appended below returns the error message \begin{pspicture} on input line [...] ended by \end{animateinline when I try to compile over ...
30
votes
1answer
578 views

Randomly bouncing balls with constant tails in a spherical constraint

How easy is the following animation made with TikZ, PSTricks, and Asymptote? Use the following as a starting template to save your time. \documentclass[border=12pt]{standalone} \begin{document} . ...
6
votes
1answer
62 views

psgraph: using \psdot changes origin?

I have the following minimal example of a document: \documentclass{article} \usepackage{pstricks-add} \begin{document} \begin{psgraph}[labels=none,ticks=none]{->}(0,0)(-8,-8)(8,8){8cm}{8cm} ...
6
votes
2answers
146 views

PSTricks: Remove trailing zeros in axis labels

Consider the following example: \documentclass{article} \usepackage{pst-plot} \begin{document} \psset{xunit = 2} \begin{pspicture}(3,1) \psaxes[Dx = 0.5]{->}(3,1) \end{pspicture} ...
2
votes
1answer
166 views

PSTricks at LyX (via pdflatex)

I'm using LyX (at Windows) and I'm trying to get pdf file output while I have PSTricks code (I put as \ERT. I Try to write at the preamble things like: \usepackage[off]{auto-pst-pdf} and ...
2
votes
2answers
89 views

Taking advantage of auto-pst-pdf when XeLaTeXing

I use a lot of PSTricks-based graphics. Since graphics generation takes an awful long compilation time over XeLaTeX, I resort to pdfLaTeX first using the auto-pst-pdf package. On a later run, meaning, ...
2
votes
1answer
61 views

How to change the current point to the tip of an arrow without using \moveto?

Consider the following code. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \begin{document} \begin{pspicture}(0,-1)(3,1) \pscustom[linejoin=1,arrows=->] { ...
3
votes
1answer
98 views

Improve ugly PSTricks code [closed]

Consider the following code: \documentclass{article} \usepackage{pstricks-add} \psset{unit = 0.47\psunit, fillstyle = solid} \begin{document} \begin{pspicture}(0.5,1)(25,12.7) ...
4
votes
1answer
79 views

Is there any multi-purpose package in PGF I can use to simplify the following?

I want to avoid using \usepackage[nomessages]{fp} and \FPeval\height{round(6*sin(pi/3):6)}% \begin{pspicture}(6,\height) just for the sake of getting more compact code, i.e., without using a ...
4
votes
2answers
168 views

How to adjust radius for \cnodeput and \circlenode?

I am trying to change the global default or customise individual size of the node plotted in the following code, however regardless what I do it seems I can only have two input for each node, either ...
6
votes
0answers
338 views

best practice to include (standalone precompiled) graphics

General understanding I know that several people have asked about how to include plots and graphics (created by tikz and pstricks) into a latex document. What is the best way to include Matlab ...
4
votes
1answer
178 views

Electron distribution box diagram

Just for sharing. Improvements are welcome. \starttext Electron distribution box diagram \startMPcode picture finalpicture ; finalpicture := nullpicture ; numeric n ; n := 0 ; bboxmargin := 0pt ; ...
8
votes
6answers
845 views

Draw Vertices of Regular Polygon

I am trying to draw just the nodes (no sides) at the vertices of a regular hexagon. This answer should be easily modified to accomplish what I want, but I am such a novice that I have difficulty ...
5
votes
1answer
140 views

Plotting graph and data with PSTricks: Wrong scaling

Consider the following code: \documentclass{article} \usepackage{pst-plot} \begin{document} % options \psset{ xunit = 5, yunit = 50 } % constants. \def\masse{0.183276667} % kg ...
8
votes
0answers
98 views

Is there any compiler-dependent font loadable for pdflatex but not for latex-dvips-ps2pdf?

I want to make sure that I can load the same fonts for each input file either for diagrams and text contents. It is related to my statement below, Even though PSTricks cannot work with pdflatex ...
12
votes
3answers
664 views

Graphing multiple functions on the same graph

I'm new to LaTeX and am attempting to type up some old differential equations notes. The only part I seem to be having trouble with is graphing multiple functions onto a single graph. For example the ...
5
votes
0answers
157 views

Scheme for Chemical Potential Energy representation [closed]

I wrote this code to schematically represent the concept of chemical potential energy. This image will be part of a representative diagram of energy transformations in a voltaic cell: chemical ...
9
votes
1answer
144 views

Why does \nodexn{(1,1)}{A} produce strange N-A.x and N-A.y?

\documentclass[preview,border=2cm]{standalone} \usepackage{pst-tools} \usepackage{pst-node} \psset{saveNodeCoors} \begin{document} \section*{With pnode} \begin{pspicture}(3,3) \pnode(1,1){A} ...
4
votes
2answers
76 views

\nodexn and savedNodeCoors not playing nicely with each other

This question arose from trying to answer a different question previously posted by @StiffJokes (aka user:19356) but now deleted. Each of the following MWE produces different results for the ...
3
votes
0answers
63 views

Why can't the abscissa and ordinate obtained from \psGetNodeCenter be reflected? [duplicate]

Consider the following simplified code. \documentclass[pstricks,border=2cm]{standalone} \usepackage{pst-eucl} \psset{saveNodeCoors} %\def\xy#1{!\psGetNodeCenter{#1} #1.x #1.y}% cannot be ...
5
votes
2answers
177 views

What is the easiest method to construct a bezier curve for the half part of a symmetric bezier curve?

Consider the following symmetric (about vertical axis) bezier curve constructed by 4 points A, B, C, and D. Now I want to construct another bezier curve (named L) for just either the left or right ...
9
votes
2answers
176 views

Cobordism with pstricks

I'm trying to get rid of the middle line. Whatever changes I make it seems that I make it worse. I would appreciate it if anyone could show me how to draw this cobordism properly. \begin{pspicture} ...
5
votes
1answer
183 views

How to get a consistent zigzag line?

I want to get a consistent zigzag line that will be used to mimic a physical spring. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-coil,multido} \usepackage[nomessages]{fp} ...
11
votes
2answers
228 views

PSTricks drawing with variables not exact

Consider the following example: \documentclass{article} \usepackage{pst-coil} \psset{dimen = middel} \def\frekvensgenerator[#1,#2](#3,#4){ \psframe(#3,#4)(!#3 #1 add #4 #2 add) \psline(!#3 #4 ...
0
votes
0answers
61 views

How I draw graphics of dominoes falling? [duplicate]

How I draw graphics of dominoes falling, without moviment, static draw?
5
votes
2answers
146 views

How to assign a random value to opacity key in PostScript phase rather than TeX phase?

I want to have a random opacity but I don't want to use fp package. Shortly speaking, is it possible to pass PostScript expression to opacity? Here is the minimal not-working example to save your ...