Skip to content
This repository was archived by the owner on Mar 22, 2026. It is now read-only.

Commit 73d5304

Browse files
committed
moved expression parsing to _construct_plot_data to allow expressions in downstream geoms
1 parent 644b0c0 commit 73d5304

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ggplot/ggplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ def __init__(self, aesthetics, data):
5353
self._aes = aesthetics
5454
self.data = data.copy()
5555
self._handle_index()
56-
self.data = self._aes._evaluate_expressions(self.data)
57-
self.data = self._aes.handle_identity_values(self.data)
58-
5956

6057
self.layers = []
6158

@@ -353,6 +350,9 @@ def _get_mapping(self, aes_type, colname):
353350

354351
def _construct_plot_data(self):
355352
"Splits up the main data based on discrete aesthetics into sub-data frames"
353+
#parsing aes relocated here from __init__ to allow for aes expressions to be supplied in subsequent geom_*()
354+
self.data = self._aes._evaluate_expressions(self.data)
355+
self.data = self._aes.handle_identity_values(self.data)
356356
data = self.data
357357
discrete_aes = self._aes._get_discrete_aes(data)
358358
mappers = {}

0 commit comments

Comments
 (0)