File: README.md

package info (click to toggle)
ipe-tools 1%3A7.2.24.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 872 kB
  • sloc: cpp: 2,696; python: 2,109; ansic: 1,053; sh: 224; makefile: 89; xml: 39
file content (88 lines) | stat: -rw-r--r-- 2,429 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
matplotlib backend
==================

This is an Ipe backend for the [Matplotlib plotting
library](http://matplotlib.org/) for Python, written by Soyeon Baek
and Otfried Cheong.

You can create Ipe files directly from Matplotlib.

To use the backend, copy the file *backend_ipe.py* somewhere on your
Python path. (The current directory will do.)

You activate the backend like this:

```python
  import matplotlib
  matplotlib.use('module://backend_ipe')
```

The Ipe backend allows you to save in Ipe format:

```python
  plt.savefig("my_plot.ipe", format="ipe")
```


Options
-------

Some plots need to measure the size of text to place labels correctly
(see the *legend_demo* test for an example).  The Ipe backend can use
a background Latex process to measure the dimensions of text as it
will appear in the Ipe document.  By default this is not enabled, as
most plots don't need it and it slows down the processing of the plot.

If you want to enable text size measuring, set the matplotlib option
*ipe.textsize* to True, for instance like this:

```python
  import matplotlib
  matplotlib.use('module://backend_ipe')
  import matplotlib.pyplot as plt
  matplotlib.rcParams['ipe.textsize'] = True
```

(Note that the *ipe* options are only available after the backend has
been loaded, here caused by importing *pyplot*.)


If you want your plot to include an Ipe stylesheet, specify this using
the option *ipe.stylesheet*, with a full pathname.  (If you don't know
where your style sheets are, use Ipe -> Help -> Show Configuration.)
Here is an example:

```python
  import matplotlib
  matplotlib.use('module://backend_ipe')
  import matplotlib.pyplot as plt
  matplotlib.rcParams['ipe.stylesheet'] = "/sw/ipe/share/ipe/7.1.6/styles/basic.isy"
```

You can set the preamble of the Ipe document using the option
*ipe.preamble*.  This is useful, for instance, when you want to use
font sizes that are not available with the standard fonts (the test
*watermark_image* needs this).  You can then switch to a Postscript
font that can be scaled to any size:

```python
  import matplotlib
  matplotlib.use('module://backend_ipe')
  import matplotlib.pyplot as plt
  matplotlib.rcParams['ipe.preamble'] = r"""
\usepackage{times}
"""
```



Problems?
---------

If you need to report a problem, please include your matplotlib version.
You can find it as follows:

```python
  import matplotlib
  print matplotlib.__version__
```