File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,11 +259,15 @@ def _table(obj, data): # noqa: C901
259259 xformat = ff
260260 col_sep = " "
261261
262- if data ["table_row_sep" ] != "\n " :
262+ table_row_sep = data ["table_row_sep" ]
263+ if table_row_sep .strip () == r"\\" and data ["externalize tables" ]:
264+ # work around ! Package pgfplots Error: Sorry, the choice 'row sep=crcr' is currently only available for inline tables, not for external files.
265+ table_row_sep = "\n "
266+
267+ if table_row_sep != "\n " :
263268 # don't want the \n in the table definition, just in the data (below)
264- opts .append ("row sep=" + data [ " table_row_sep" ] .strip ())
269+ opts .append ("row sep=" + table_row_sep .strip ())
265270
266- table_row_sep = data ["table_row_sep" ]
267271 ydata [ydata_mask ] = np .nan
268272 if np .any (ydata_mask ) or ~ np .all (np .isfinite (ydata )):
269273 # matplotlib jumps at masked or nan values, while PGFPlots by default
Original file line number Diff line number Diff line change @@ -127,6 +127,17 @@ def draw_pathcollection(data, obj):
127127
128128 is_filled = False
129129
130+ table_row_sep = data ["table_row_sep" ]
131+ if table_row_sep .strip () == r"\\" and data ["externalize tables" ]:
132+ # work around ! Package pgfplots Error: Sorry, the choice 'row sep=crcr' is currently only available for inline tables, not for external files.
133+ table_row_sep = "\n "
134+
135+ if table_row_sep != "\n " :
136+ # don't want the \n in the table definition, just in the data (below)
137+ table_options .append ("row sep=" + table_row_sep .strip ())
138+
139+
140+
130141 if obj .get_array () is not None :
131142 dd_strings = np .column_stack ([dd_strings , obj .get_array ()])
132143 labels .append ("colordata" )
@@ -302,9 +313,9 @@ def draw_pathcollection(data, obj):
302313 content .append ("table{" )
303314
304315 plot_table = []
305- plot_table .append (" " .join (labels ) + " \n " )
316+ plot_table .append (" " .join (labels ) + table_row_sep )
306317 for row in dd_strings :
307- plot_table .append (" " .join (row ) + " \n " )
318+ plot_table .append (" " .join (row ) + table_row_sep )
308319
309320 if data ["externalize tables" ]:
310321 filepath , rel_filepath = _files .new_filepath (data , "table" , ".dat" )
You can’t perform that action at this time.
0 commit comments