Hi All,
I’m encountering an error when trying to plot ellipses using pygmt in a notebook, and I’m not sure what to make of it.
I tried the following from the tutorial on multi-parameter symbols:
In:
# ELLIPSE
data = [[0.5, 1, 45, 3, 1]]
fig.plot(data=data, style="e", color="orange", pen="2p,black")
AttributeError Traceback (most recent call last)
<ipython-input-24-82859c6b5f8c> in <module>
1 # ELLIPSE
2 data = [[0.5, 1, 45, 3, 1]]
----> 3 fig.plot(data=data, style="e", color="orange", pen="2p,black")
~\Anaconda3\envs\pygmt\lib\site-packages\pygmt\helpers\decorators.py in new_module(*args, **kwargs)
268 if alias in kwargs:
269 kwargs[arg] = kwargs.pop(alias)
--> 270 return module_func(*args, **kwargs)
271
272 new_module.aliases = aliases
~\Anaconda3\envs\pygmt\lib\site-packages\pygmt\helpers\decorators.py in new_module(*args, **kwargs)
409 kwargs[arg] = separators[fmt].join(f"{item}" for item in value)
410 # Execute the original function and return its output
--> 411 return module_func(*args, **kwargs)
412
413 return new_module
~\Anaconda3\envs\pygmt\lib\site-packages\pygmt\base_plotting.py in plot(self, x, y, data, sizes, direction, **kwargs)
817 )
818
--> 819 with file_context as fname:
820 arg_str = " ".join([fname, build_arg_string(kwargs)])
821 lib.call_module("plot", arg_str)
~\Anaconda3\envs\pygmt\lib\contextlib.py in __enter__(self)
111 del self.args, self.kwds, self.func
112 try:
--> 113 return next(self.gen)
114 except StopIteration:
115 raise RuntimeError("generator didn't yield") from None
~\Anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\session.py in virtualfile_from_matrix(self, matrix)
1268 # guarantees that the copy will be around until the virtual file is
1269 # closed.
-> 1270 matrix = as_c_contiguous(matrix)
1271 rows, columns = matrix.shape
1272
~\Anaconda3\envs\pygmt\lib\site-packages\pygmt\clib\conversion.py in as_c_contiguous(array)
204
205 """
--> 206 if not array.flags.c_contiguous:
207 return array.copy(order="C")
208 return array
AttributeError: 'list' object has no attribute 'flags'
I’m on windows 10 using a pygmt environment and I’m still a bit of a noob. Please help!
Cheers,
Tom