Skip to content

Commit 22b6189

Browse files
committed
suggestions
1 parent 0d855df commit 22b6189

File tree

9 files changed

+28
-25
lines changed

9 files changed

+28
-25
lines changed

docs/tutorial/plotters.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ Plotters
55
The COMPAS plotters (:mod:`compas_plotters`) provide an easy-to-use inteface for basic 2D visualisation
66
of COMPAS objects based on matplotlib.
77

8-
The package contains four types of plotters: :class:`compas_plotters.GeometryPlotter`, :class:`compas_plotters.NetworkPlotter`, :class:`compas_plotters.MeshPlotter`, and ... :class:`compas_plotters.Plotter`.
8+
The package contains four types of plotters:
9+
:class:`compas_plotters.GeometryPlotter`,
10+
:class:`compas_plotters.NetworkPlotter`,
11+
:class:`compas_plotters.MeshPlotter`, and ... :class:`compas_plotters.Plotter`.
912
The first three are deprecated in favour of :class:`compas_plotters.Plotter`, which is therefore the only one that will be described in this tutorial.
1013

1114

src/compas_plotters/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
compas_plotters
44
********************************************************************************
55
6-
2D visualisation framework based on ``matplotlib`` for COMPAS geometry objects and data structures.
6+
2D visualization framework based on ``matplotlib`` for COMPAS geometry objects and data structures.
77
88
.. currentmodule:: compas_plotters
99

src/compas_plotters/_plotter.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class BasePlotter:
6565
Other Parameters
6666
----------------
6767
dpi : float, optional
68-
The resolution of the plot.
68+
The resolution of the plot in "dots per inch".
6969
Default is ``100.0``.
7070
tight : bool, optional
7171
Produce a plot with limited padding between the plot and the edge of the figure.
@@ -94,8 +94,8 @@ class BasePlotter:
9494
9595
"""
9696

97-
def __init__(self, figsize=(16.0, 12.0), dpi=100.0, tight=True, axes=None, **kwargs):
98-
"""Initialises a plotter object"""
97+
def __init__(self, figsize=(16.0, 12.0), dpi=100.0, tight=True, axes=None, fontsize=10, **kwargs):
98+
"""Initializes a plotter object"""
9999
self._axes = None
100100
self.axes = axes
101101
self.tight = tight
@@ -118,18 +118,18 @@ def __init__(self, figsize=(16.0, 12.0), dpi=100.0, tight=True, axes=None, **kwa
118118
'point.edgecolor': '#000000',
119119
'point.edgewidth': 0.5,
120120
'point.textcolor': '#000000',
121-
'point.fontsize': kwargs.get('fontsize', 10),
121+
'point.fontsize': fontsize,
122122

123123
'line.width': 1.0,
124124
'line.color': '#000000',
125125
'line.textcolor': '#000000',
126-
'line.fontsize': kwargs.get('fontsize', 10),
126+
'line.fontsize': fontsize,
127127

128128
'polygon.facecolor': '#ffffff',
129129
'polygon.edgecolor': '#000000',
130130
'polygon.edgewidth': 0.1,
131131
'polygon.textcolor': '#000000',
132-
'polygon.fontsize': kwargs.get('fontsize', 10),
132+
'polygon.fontsize': fontsize,
133133
}
134134

135135
@property
@@ -211,7 +211,7 @@ def bgcolor(self, value):
211211
Parameters
212212
----------
213213
value : str, tuple
214-
The color specififcation for the figure background.
214+
The color specification for the figure background.
215215
Colors should be specified in the form of a string (hex colors) or
216216
as a tuple of normalized RGB components.
217217
@@ -432,7 +432,7 @@ def draw_points(self, points):
432432
* edgecolor (rgb or hex color, optional): The color of the edge of the cicrle. Default is black.
433433
* edgewidth (float, optional): The width of the edge of the circle. Default is 1.0.
434434
* textcolor (rgb or hex color, optional): Color of the text label. Default is black.
435-
* fontsize (int, optional): Font size of the text label. Default is 12.
435+
* fontsize (int, optional): Font size of the text label. Default is ``12``.
436436
437437
Returns
438438
-------
@@ -457,7 +457,7 @@ def draw_lines(self, lines):
457457
* color (rgb tuple or hex string, optional): The color of the line. Default is black.
458458
* text (str, optional): The text of the label. Default is ``None``.
459459
* textcolor (rgb tuple or hex string, optional): Color of the label text. Default is black.
460-
* fontsize (int, optional): The size of the font of the label text. Default is ```12``.
460+
* fontsize (int, optional): The size of the font of the label text. Default is ``12``.
461461
462462
Returns
463463
-------
@@ -479,7 +479,7 @@ def draw_polylines(self, polylines):
479479
* points (list): XY(Z) coordinates of the polygon vertices.
480480
* text (str, optional): The text of the label. Default is ``None``.
481481
* textcolor (rgb tuple or hex string, optional): Color of the label text. Default is black.
482-
* fontsize (int, optional): The size of the font of the label text. Default is ```12``.
482+
* fontsize (int, optional): The size of the font of the label text. Default is ``12``.
483483
* facecolor (rgb tuple or hex string, optional): Color of the polygon face. Default is white.
484484
* edgecolor (rgb tuple or hex string, optional): Color of the edge of the polygon. Default is black.
485485
* edgewidth (float): Width of the polygon edge. Default is ``1.0``.
@@ -504,7 +504,7 @@ def draw_polygons(self, polygons):
504504
* points (list): XY(Z) coordinates of the polygon vertices.
505505
* text (str, optional): The text of the label. Default is ``None``.
506506
* textcolor (rgb tuple or hex string, optional): Color of the label text. Default is black.
507-
* fontsize (int, optional): The size of the font of the label text. Default is ```12``.
507+
* fontsize (int, optional): The size of the font of the label text. Default is ``12``.
508508
* facecolor (rgb tuple or hex string, optional): Color of the polygon face. Default is white.
509509
* edgecolor (rgb tuple or hex string, optional): Color of the edge of the polygon. Default is black.
510510
* edgewidth (float): Width of the polygon edge. Default is ``1.0``.
@@ -530,7 +530,7 @@ def draw_arrows(self, arrows):
530530
* end (list): XY(Z) coordinates of the end point.
531531
* text (str, optional): The text of the label. Default is ``None``.
532532
* textcolor (rgb tuple or hex string, optional): Color of the label text. Default is black.
533-
* fontsize (int, optional): The size of the font of the label text. Default is ```6``.
533+
* fontsize (int, optional): The size of the font of the label text. Default is ``6``.
534534
* color (rgb tuple or hex string, optional): Color of the arrow. Default is black.
535535
* width (float): Width of the arrow. Default is ``1.0``.
536536
@@ -562,7 +562,7 @@ def update(self, pause=0.0001):
562562
Parameters
563563
----------
564564
pause : float
565-
Ammount of time to pause the plot in seconds.
565+
Amount of time to pause the plot in seconds.
566566
567567
"""
568568
self.axes.autoscale()

src/compas_plotters/core/drawing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create_axes_xy(figsize=(8.0, 6.0),
5757
xscale='linear',
5858
yscale='linear',
5959
bgcolor='#ffffff'):
60-
"""Initialises plot axes object for matplotlib plotting.
60+
"""Initializes plot axes object for matplotlib plotting.
6161
6262
Parameters
6363
----------
@@ -147,7 +147,7 @@ def create_axes_3d(size=(10, 7),
147147
ticklength=20,
148148
tickfontsize=15,
149149
angle=(30, 45)):
150-
"""Initialises plot axes object for matplotlib plotting.
150+
"""Initializes plot axes object for matplotlib plotting.
151151
152152
Parameters
153153
----------

src/compas_plotters/core/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Axes2D(object):
3333
"""
3434

3535
def __init__(self, origin, vectors):
36-
"""Initialises the Axes2D object"""
36+
"""Initializes the Axes2D object"""
3737
self.origin = asarray(origin)
3838
self.vectors = asarray(vectors)
3939

@@ -81,7 +81,7 @@ class Axes3D(object):
8181
"""
8282

8383
def __init__(self, origin, vectors, colors=None):
84-
"""Initialises the Axes3D object"""
84+
"""Initializes the Axes3D object"""
8585
self.origin = asarray(origin)
8686
self.vectors = asarray(vectors)
8787
if not colors:

src/compas_plotters/geometryplotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class GeometryPlotter:
9-
"""Plotter for the visualisation of COMPAS geometry.
9+
"""Plotter for the visualization of COMPAS geometry.
1010
1111
Parameters
1212
----------

src/compas_plotters/meshplotter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class MeshPlotter(BasePlotter):
14-
"""Plotter for the visualisation of COMPAS meshes.
14+
"""Plotter for the visualization of COMPAS meshes.
1515
1616
Parameters
1717
----------
@@ -35,7 +35,7 @@ class MeshPlotter(BasePlotter):
3535
3636
Examples
3737
--------
38-
This is a basic example using the default settings for all visualisation options.
38+
This is a basic example using the default settings for all visualization options.
3939
For more detailed examples, see the documentation of the various drawing methods
4040
listed below...
4141

src/compas_plotters/networkplotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class NetworkPlotter(BasePlotter):
9-
"""Plotter for the visualisation of COMPAS Networks.
9+
"""Plotter for the visualization of COMPAS Networks.
1010
1111
Parameters
1212
----------

src/compas_plotters/plotter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class Plotter:
13-
"""Plotter for the visualisation of COMPAS geometry.
13+
"""Plotter for the visualization of COMPAS geometry.
1414
1515
Parameters
1616
----------
@@ -329,7 +329,7 @@ def redraw(self, pause: Optional[float] = None) -> None:
329329
Parameters
330330
----------
331331
pause : float
332-
Ammount of time to pause the plot in seconds.
332+
Amount of time to pause the plot in seconds.
333333
334334
"""
335335
for artist in self._artists:

0 commit comments

Comments
 (0)