Questions tagged [pyx]

PyX is a Python package for the creation of PostScript, PDF, and SVG files. It combines an abstraction of the PostScript drawing model with a TeX/LaTeX interface. Complex tasks like 2d and 3d plots in publication-ready quality are built out of these primitives.

PyX is in steady development. Planned features are listed on the roadmap. The current release, PyX 0.15, is available at the download section of the project page.

57 questions
0
votes
0 answers

Cannot install nor use Py3ODE cloned code

As a context, I work on Windows 10 machine and did update pip (23.1.2) and python (3.11.3) I am trying to run an open source code that is a bit old (this one if that helps -> https://github.com/locuslab/lcp-physics/tree/master). There are two…
Tom242
  • 1
0
votes
1 answer

expose c++ class to cython via module

What do I want to do: install a python/cython module exposing a c++ class and being able to cimport it in any .pyx files later. What does not work: I cannot manage to cimport the file once the module is installed. The cython compilation is working…
boris
  • 378
  • 1
  • 4
  • 16
0
votes
1 answer

Stroked and filled rectangle created by PyX is rendered incorrectly by Ghostscript

I created a PDF file using the PyX Python package, showing a black stroked rectangle filled in red. When I preview the PDF file using Evince it looks as expected (Evince screenshot). However when I preview it using Ghostscript either the fill does…
0
votes
1 answer

Is it possible to typeset fractions with pyx?

I have this python snippet: from pyx import * from pyx import text text.set(mode="latex") text.preamble(r"\usepackage{amssymb}") text.preamble(r"\usepackage{amsmath}") c.text(-0.5, 0.1, r"\huge{$\frac{8}{3}$}", [text.halign.boxcenter]) Which is…
Makogan
  • 8,208
  • 7
  • 44
  • 112
0
votes
1 answer

How to get paragraphs of text by index number

I am wondering if there is a way to get paragraphs of text (source file would be a pyx file) by number as sed does with lines sed -n ${i}p At this moment I'd be interested to use awk with: awk '/custom-pyx-tag\(/,/\)custom-pyx-tag/' but I can't find…
0
votes
1 answer

Python Pyx: remove repeated color bars in density plot

I wanna have multiple density plots in one Python Pyx plot. I can do this to have two density plots: Question: how to remove unecessary repeated color bar? Example code is from here: from pyx import * f = canvas.canvas() re_min = -2 re_max =…
Nigel1
  • 95
  • 8
0
votes
1 answer

Pyx have a curve and its curve text have different colors

Silly question but, I have the following pyx diagram: I want the text in the edges to be black but the edges themselves to stay red. This is my code: c.stroke(path.line(p1[0], p1[1], p2[0], p2[1]), [ style.linecap.round,…
Makogan
  • 8,208
  • 7
  • 44
  • 112
0
votes
2 answers

Using PyX, how can I set the size of the canvas?

Beginner's question using PyX in Python 3.8.1. I'm creating an EPS file, and would like the canvas size to be 70 mm x 70 mm. How can I do this? from pyx import * # build and size canvas c = canvas.canvas() c.fill(path.circle(2.5, 1.5,…
To Ch
  • 1
0
votes
1 answer

How to fix 'FileNotFoundError' when using pyx.canvas.writeGSfile() in Python?

I would like to generate a jpeg or png file using the Pyx module. I found pyx.canvas.writeGSfile() which I tried to use in the following code: from pyx import * def mark(x, y): return path.circle(x, y, 0.1) if __name__ == '__main__': c…
RtR
  • 5
  • 2
0
votes
1 answer

PyCharm CE does not recognize .pyx files

PyCharm Community Edition (CE) does not recognize few Cython files as shown in the picture below (with PyCharm red mark under the file name). Could you please advise me on what can I do ?
erezlale
  • 625
  • 2
  • 6
  • 17
0
votes
1 answer

Python Pyx Plot: How to split graph key?

Consider below PyX plot How to arrange graph key so that instead of one verticle list of 4 entries, there are 2 lists (each of 2 entries) side by side? I mean, instead of key: x = y^4, x = y^2, x = y, y = x^4, Having key: x = y^4, x = y x =…
Nigel1
  • 95
  • 8
0
votes
1 answer

Center alignment of text in PyX

I am using PyX to create rectangles and putting some (LaTex) text within the rectangle. # python 3 from pyx import * text.set(text.LatexRunner) c = canvas.canvas() c.stroke(path.rect(0, 0, 1, 1), [style.linewidth.Thick, …
hola
  • 930
  • 1
  • 17
  • 35
0
votes
1 answer

How to suppress PyX warning messages when using Scapy to generate a PDF of a packet?

I am generating a PDF of a packet using Scapy's pdfdump method: from scapy.layers.inet import ICMP, IP packet = IP(dst="192.168.111.1") / ICMP() packet.pdfdump("report.pdf") When this code is executred, there are lots of messages printed out from…
jfleach
  • 501
  • 1
  • 8
  • 21
0
votes
2 answers

Python Pyx plot: How to change color background of plot?

I have plot in PyX in python g = graph.graphxy(width=8, x=graph.axis.log(min=1e-1, max=1e4, title=r"$x$-axis"), y=graph.axis.lin(max=5, title=r"$y$-axis")) g.plot(graph.data.function("y(x)=tan(log(1/x))**2")) …
Nigel1
  • 95
  • 8
0
votes
1 answer

Python Pyx plot: changing spacing between dots in dotted line

I have plot in Pyx module with Python: g = graph.graphxy(width=8, x=graph.axis.linear(min=0, max=2), y=graph.axis.linear(min=0, max=2), ) g.plot([graph.data.function("x(y)=y**4")], …
Nigel1
  • 95
  • 8