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

2
votes
2answers
1k 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) \psaxes[linecolor=gray,tickcolor=gray]{->}(0,0)(-5,-1)(5,5)[$x$,...
5
votes
1answer
166 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
138 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) \pscustom[...
2
votes
1answer
80 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
103 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 \begin{pspicture}[showgrid](-5,-5)(5,...
5
votes
1answer
116 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 ...
42
votes
9answers
3k 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
287 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
2k 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
2answers
166 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
75 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 \begin{pspicture}(-4,-...
8
votes
2answers
973 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
397 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} \colorlet{...
1
vote
1answer
136 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
229 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
711 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
150 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} \pnode(...
6
votes
2answers
233 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} \end{document}...
3
votes
1answer
567 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 \usepackage[...
2
votes
2answers
160 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
177 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
185 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) \psframe(3,1)(10,10)...
4
votes
1answer
98 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
674 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 "{...
13
votes
1answer
2k 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
280 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 ; ...
9
votes
6answers
5k 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
360 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 \def\kraft{0....
10
votes
1answer
171 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
2k 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
242 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
162 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
87 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
64 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
332 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
233 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
800 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} \FPset\...
11
votes
2answers
381 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
64 views

How I draw graphics of dominoes falling? [duplicate]

How I draw graphics of dominoes falling, without moviment, static draw?
5
votes
2answers
297 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 ...
6
votes
1answer
425 views

Plot functions and data together using PSTricks

I would like to create the following graph using PSTricks: The data, which can be downloaded from http://gupl.dk/705644/, should be plotted together with the three graphs. I have managed to plot ...
5
votes
1answer
323 views

Save from LyX to PNG

I have a LyX file with a PSTricks picture. Currently, when I want to convert it to a PNG image, I save the file as PS, then open the PS in gimp, then save it as PNG. Is there a way to save to PNG ...
41
votes
5answers
3k views

Showcase of translations to Asymptote from TikZ/PSTricks

So you already know TikZ and/or PSTricks, but you would like to expand your knowledge by learning Asymptote as well? Here's your chance. The task/question: Find an example of an impressive diagram ...
3
votes
3answers
305 views

Repeated line drawing

I am trying to draw a diagram , which contains repeated lines for that i would like to use a new command. what would be the best command? any suggestions? That diagram is this and not to worry about ...
8
votes
3answers
757 views

How to give different color to each pie?

I've gone through the answer in Package for pie charts. Can you please suggest, how to give different color for each pie?
5
votes
1answer
198 views

How to make \reversepath useful for drawing the following closed curve?

I want to draw a batman logo. As it is symmetric about the vertical line, it should be more convenient to just define the right part (or the left part) first and then reflect it to get the other part. ...
8
votes
4answers
241 views

Draw part of ring with non-zero thickness using PSTricks

Is there a command for drawing part of a ring with non-zero thickness using PSTricks? I know of \psRing but this draws a full ring. What I want is similar to \pswedge but without the part of the ...
14
votes
1answer
880 views

Color gradient filling along a path

I want to make the gradient color to follow the pipe curve below rather than to span from the left to the right. The following MWE shows the default behavior which is not what I'm looking for. \...
4
votes
2answers
176 views

How can I get correct picture?

I used Geogebra to draw the graph of the function $y = 2x^2 - 4x$. This is my code \documentclass[10pt]{article} \usepackage{pstricks-add} \pagestyle{empty} \begin{document} \psset{xunit=1.0cm,yunit=...
3
votes
1answer
282 views

How to fill a specified area using PSTricks

I want to fill some regions which are only parts of a shape in a PSTricks drawing (marked with some dashed \psline in the following drawings ): % !TEX TS-program = latex \documentclass{standalone}...