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
1answer
285 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
74 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 ...
8
votes
2answers
950 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
385 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
133 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
224 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
704 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} ...
6
votes
2answers
230 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} ...
3
votes
1answer
549 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
154 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
174 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
180 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
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
650 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
275 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
354 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 ...
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
237 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
160 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
330 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
231 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
772 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
371 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
292 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
421 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
306 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
2k 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
301 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
745 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
239 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
869 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
175 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} ...
3
votes
1answer
272 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 ...
3
votes
1answer
376 views

Mysterious problem with ps2pdf in texlive 2013

The following code comiled fine in texlive 2012, but gives me an error now: Error: /typecheck in --restore-- Operand stack: --nostringval-- --nostringval-- --nostringval-- 502.75 80.6952 ...
19
votes
2answers
3k views

How to make dominoes falling?

How to maker a LaTex drawing of dominoes falling as the following figure?
27
votes
2answers
1k views

Chaotic billiard with TikZ

I'm looking for a TikZ library that could help me to represent different shapes of chaotic billiards. Any idea?
3
votes
2answers
398 views

How to draw a tree?

How to draw a tree like using LaTeX and how can I give the labelling to the vertices and the edges?
1
vote
0answers
189 views

Beamer–PSTricks Diagram “Wiggling” [closed]

I am working on a presentation using Beamer with diagrams done in PSTricks. I would like to animate one of my diagrams, and have achieved this by using various \only, \uncover, etc. statements. ...
30
votes
2answers
2k views

How to plot a lattice of points on the surface of a torus?

I am doing a report on the Ising model, without going into the complex details of the model, in its two-dimensional form it involves a lattice of points. Which, when periodic boundary conditions ...
6
votes
1answer
254 views

Pie Chart : Overlapping Text

I'm able to draw pie chart using tex code mentioned below: \begin{center} \begin{pspicture}(-7,-4)(7,4) \psset{unit=1.2} ...