Following the tutoriañ 1-getting-started.ipynb, I encounter the following error at cell [23] : toy_traj.plot(column="speed")
IndexError Traceback (most recent call last)
Input In [23], in <cell line: 1>()
----> 1 toy_traj.plot(column="speed")
File ~/proyectos/examples/movingpandas/movingpandas/trajectory.py:215, in Trajectory.plot(self, *args, **kwargs)
194 def plot(self, *args, **kwargs):
195 """
196 Generate a plot using GeoPandas default plotting (Matplotlib).
197
(...)
213 >>> trajectory.plot(column='speed', legend=True, figsize=(9,5))
214 """
--> 215 return _TrajectoryPlotter(self, *args, **kwargs).plot()
File ~/proyectos/examples/movingpandas/movingpandas/trajectory_plotter.py:106, in _TrajectoryPlotter.plot(self)
104 if not self.ax:
105 self.ax = plt.figure(figsize=self.figsize).add_subplot(1, 1, 1)
--> 106 ax = self._plot_trajectory(self.data)
107 self.kwargs[
108 "legend"
109 ] = False # has to be removed after the first iteration, otherwise we get multiple legends! # noqa E501
110 self.kwargs.pop(
111 "column", None
112 ) # has to be popped, otherwise there's an error in the following plot call
File ~/proyectos/examples/movingpandas/movingpandas/trajectory_plotter.py:64, in _TrajectoryPlotter._plot_trajectory(self, traj)
62 self.kwargs.pop("vmin", None)
63 self.kwargs.pop("vmax", None)
---> 64 return temp_df.plot(
65 ax=self.ax,
66 vmin=self.min_value,
67 vmax=self.max_value,
68 *self.args,
69 **self.kwargs
70 )
File ~/anaconda3/lib/python3.8/site-packages/geopandas/geodataframe.py:899, in GeoDataFrame.plot(self, *args, **kwargs)
889 def plot(self, *args, **kwargs):
890 """Generate a plot of the geometries in the GeoDataFrame
.
891
892 If the column
parameter is given, colors plot according to values
(...)
897 from there.
898 """
--> 899 return plot_dataframe(self, *args, **kwargs)
File ~/anaconda3/lib/python3.8/site-packages/geopandas/plotting.py:730, in plot_dataframe(df, column, cmap, color, ax, cax, categorical, legend, scheme, k, vmin, vmax, markersize, figsize, legend_kwds, categories, classification_kwds, missing_kwds, aspect, **style_kwds)
728 subset = values[line_idx & np.invert(nan_idx)]
729 if not lines.empty:
--> 730 _plot_linestring_collection(
731 ax, lines, subset, vmin=mn, vmax=mx, cmap=cmap, **style_kwds
732 )
734 # plot all Points in the same collection
735 points = expl_series[point_idx & np.invert(nan_idx)]
File ~/anaconda3/lib/python3.8/site-packages/geopandas/plotting.py:203, in _plot_linestring_collection(ax, geoms, values, color, cmap, vmin, vmax, **kwargs)
199 kwargs["color"] = color
201 _expand_kwargs(kwargs, multiindex)
--> 203 segments = [np.array(linestring)[:, :2] for linestring in geoms]
204 collection = LineCollection(segments, **kwargs)
206 if values is not None:
File ~/anaconda3/lib/python3.8/site-packages/geopandas/plotting.py:203, in (.0)
199 kwargs["color"] = color
201 _expand_kwargs(kwargs, multiindex)
--> 203 segments = [np.array(linestring)[:, :2] for linestring in geoms]
204 collection = LineCollection(segments, **kwargs)
206 if values is not None:
IndexError: too many indices for array
Installation seems ok: