|
3 | 3 | Does not define any special non-GMT methods (savefig, show, etc).
|
4 | 4 | """
|
5 | 5 | import contextlib
|
6 |
| -import csv |
7 | 6 | import numpy as np
|
8 |
| -import pandas as pd |
9 | 7 |
|
10 | 8 | from .clib import Session
|
11 | 9 | from .exceptions import GMTInvalidInput
|
|
14 | 12 | dummy_context,
|
15 | 13 | data_kind,
|
16 | 14 | fmt_docstring,
|
17 |
| - GMTTempFile, |
18 | 15 | use_alias,
|
19 | 16 | kwargs_to_strings,
|
20 | 17 | )
|
@@ -970,14 +967,13 @@ def text(
|
970 | 967 | if position is not None and isinstance(position, str):
|
971 | 968 | kwargs["F"] += f'+c{position}+t"{text}"'
|
972 | 969 |
|
973 |
| - with GMTTempFile(suffix=".txt") as tmpfile: |
974 |
| - with Session() as lib: |
975 |
| - if kind == "file" or (kind == "vectors" and position is not None): |
976 |
| - file_context = dummy_context(textfiles) |
977 |
| - elif kind == "vectors" and position is None: |
978 |
| - file_context = lib.virtualfile_from_vectors( |
979 |
| - np.atleast_1d(x), np.atleast_1d(y), np.atleast_1d(text) |
980 |
| - ) |
981 |
| - with file_context as fname: |
982 |
| - arg_str = " ".join([fname, build_arg_string(kwargs)]) |
983 |
| - lib.call_module("text", arg_str) |
| 970 | + with Session() as lib: |
| 971 | + if kind == "file" or (kind == "vectors" and position is not None): |
| 972 | + file_context = dummy_context(textfiles) |
| 973 | + elif kind == "vectors" and position is None: |
| 974 | + file_context = lib.virtualfile_from_vectors( |
| 975 | + np.atleast_1d(x), np.atleast_1d(y), np.atleast_1d(text) |
| 976 | + ) |
| 977 | + with file_context as fname: |
| 978 | + arg_str = " ".join([fname, build_arg_string(kwargs)]) |
| 979 | + lib.call_module("text", arg_str) |
0 commit comments