tikzplot42 0.6.4__tar.gz → 0.6.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/PKG-INFO +2 -1
  2. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/pyproject.toml +2 -2
  3. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/axes.py +137 -66
  4. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/axes.pyi +29 -20
  5. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/axes3d.py +2 -1
  6. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/colorbar.py +11 -7
  7. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/colors.py +4 -4
  8. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/elements.py +13 -2
  9. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/figure.py +4 -0
  10. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/figure.pyi +30 -8
  11. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/plots.py +11 -2
  12. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/plots.pyi +34 -6
  13. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot42.egg-info/PKG-INFO +2 -1
  14. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot42.egg-info/requires.txt +1 -0
  15. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test27.py +1 -1
  16. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/LICENSE +0 -0
  17. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/README.md +0 -0
  18. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/setup.cfg +0 -0
  19. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/__init__.py +0 -0
  20. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/__init__.pyi +0 -0
  21. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/arrows.py +0 -0
  22. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/axes3d.pyi +0 -0
  23. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/border_finder.py +0 -0
  24. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/colorbar.pyi +0 -0
  25. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/config.py +0 -0
  26. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/config.pyi +0 -0
  27. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/elements.pyi +0 -0
  28. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/latex_special.py +0 -0
  29. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/pie.py +0 -0
  30. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/py.typed +0 -0
  31. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/state.py +0 -0
  32. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/styles.py +0 -0
  33. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/styles.pyi +0 -0
  34. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot/texts.py +0 -0
  35. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot42.egg-info/SOURCES.txt +0 -0
  36. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot42.egg-info/dependency_links.txt +0 -0
  37. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/src/tikzplot42.egg-info/top_level.txt +0 -0
  38. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test1.py +0 -0
  39. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test10.py +0 -0
  40. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test11.py +0 -0
  41. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test12.py +0 -0
  42. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test13.py +0 -0
  43. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test14.py +0 -0
  44. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test15.py +0 -0
  45. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test16.py +0 -0
  46. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test17.py +0 -0
  47. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test18.py +0 -0
  48. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test19.py +0 -0
  49. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test2.py +0 -0
  50. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test20.py +0 -0
  51. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test21.py +0 -0
  52. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test22.py +0 -0
  53. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test23.py +0 -0
  54. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test24.py +0 -0
  55. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test25.py +0 -0
  56. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test26.py +0 -0
  57. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test28.py +0 -0
  58. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test3.py +0 -0
  59. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test4.py +0 -0
  60. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test5.py +0 -0
  61. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test6.py +0 -0
  62. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test7.py +0 -0
  63. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test8.py +0 -0
  64. {tikzplot42-0.6.4 → tikzplot42-0.6.7}/tests/test9.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tikzplot42
3
- Version: 0.6.4
3
+ Version: 0.6.7
4
4
  Summary: TikzPlot to make TikZ/PGFPlots plots with matplotlib.pyplot-like syntax.
5
5
  Author-email: Zan Ambrozic <zan.ambrozic7@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -696,6 +696,7 @@ License-File: LICENSE
696
696
  Requires-Dist: numpy
697
697
  Requires-Dist: matplotlib
698
698
  Requires-Dist: scipy
699
+ Requires-Dist: scikit-image
699
700
  Dynamic: license-file
700
701
 
701
702
  # TikzPlot
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tikzplot42"
7
- version = "0.6.4"
7
+ version = "0.6.7"
8
8
  description = "TikzPlot to make TikZ/PGFPlots plots with matplotlib.pyplot-like syntax."
9
9
  authors = [
10
10
  { name = "Zan Ambrozic", email = "zan.ambrozic7@gmail.com" }
@@ -23,7 +23,7 @@ classifiers = [
23
23
  "Programming Language :: Python :: 3.14",
24
24
  "Topic :: Scientific/Engineering :: Visualization",
25
25
  ]
26
- dependencies = ["numpy", "matplotlib", "scipy"]
26
+ dependencies = ["numpy", "matplotlib", "scipy", "scikit-image"]
27
27
 
28
28
  [project.urls]
29
29
  Homepage = "https://github.com/ZanAmb/TikzPlot"
@@ -1,7 +1,6 @@
1
- from math import isqrt
2
- from turtle import pos
3
1
  from typing import Any, Iterable, Tuple
4
2
  import copy
3
+ import warnings
5
4
 
6
5
  import numpy as _np
7
6
  import matplotlib.pyplot as _plt
@@ -191,7 +190,7 @@ class BaseAxes:
191
190
  def _check_kwargs(self, func, allowed, **kwargs):
192
191
  blacklist = set(kwargs) - allowed
193
192
  for b in blacklist:
194
- raise Warning(f"Ignoring unknown kwarg for {func}: {b}")
193
+ warnings.warn(f"Ignoring unknown kwarg for {func}: {b}", Warning)
195
194
  return {k: v for k, v in kwargs.items() if k in allowed}
196
195
 
197
196
  def plot(self, *args, **kwargs):
@@ -303,32 +302,36 @@ class BaseAxes:
303
302
 
304
303
  x_min, x_max = (x.min(), x.max())
305
304
  y_min, y_max = (y.min(), y.max())
305
+ domain_dx = abs(x_max - x_min) if x_max != x_min else 1.0
306
+ domain_dy = abs(y_max - y_min) if y_max != y_min else 1.0
306
307
  x_1d = _np.asarray(x[0, :] if x.ndim == 2 else x).flatten()
307
308
  y_1d = _np.asarray(y[:, 0] if y.ndim == 2 else y).flatten()
308
- interp_u = RegularGridInterpolator((x_1d, y_1d), u.T, bounds_error=False, fill_value=0.0)
309
- interp_v = RegularGridInterpolator((x_1d, y_1d), v.T, bounds_error=False, fill_value=0.0)
309
+ x_1d_n = (x_1d - x_min) / domain_dx
310
+ y_1d_n = (y_1d - y_min) / domain_dy
311
+ interp_u = RegularGridInterpolator((x_1d_n, y_1d_n), u.T / domain_dx, bounds_error=False, fill_value=0.0)
312
+ interp_v = RegularGridInterpolator((x_1d_n, y_1d_n), v.T / domain_dy, bounds_error=False, fill_value=0.0)
310
313
  start_points_set = start_points is not None
311
314
  if start_points is None:
312
315
  nx = int(10 * density)
313
316
  ny = int(10 * density)
314
- xs = _np.linspace(x_min, x_max, nx + 1)
315
- ys = _np.linspace(y_min, y_max, ny + 1)
317
+ xs = _np.linspace(0, 1, nx + 1)
318
+ ys = _np.linspace(0, 1, ny + 1)
316
319
  xc = 0.5 * (xs[:-1] + xs[1:])
317
320
  yc = 0.5 * (ys[:-1] + ys[1:])
318
321
  seed_x, seed_y = _np.meshgrid(xc, yc)
319
322
  seeds = _np.column_stack([seed_x.ravel(), seed_y.ravel()])
320
323
  if not broken_streamlines:
321
324
  dist_to_boundary = _np.minimum(
322
- _np.minimum(seeds[:, 0] - x_min, x_max - seeds[:, 0]),
323
- _np.minimum(seeds[:, 1] - y_min, y_max - seeds[:, 1])
325
+ _np.minimum(seeds[:, 0], 1 - seeds[:, 0]),
326
+ _np.minimum(seeds[:, 1], 1 - seeds[:, 1])
324
327
  )
325
328
  sort_idx = _np.argsort(dist_to_boundary)
326
329
  seeds = seeds[sort_idx]
327
330
  else:
328
- seeds = _np.asarray(start_points)
331
+ seeds = _np.asarray(start_points).copy()
332
+ seeds[:, 0] = (seeds[:, 0] - x_min) / domain_dx
333
+ seeds[:, 1] = (seeds[:, 1] - y_min) / domain_dy
329
334
 
330
- domain_dx = abs(x_max - x_min)
331
- domain_dy = abs(y_max - y_min)
332
335
  if start_points_set and not broken_streamlines:
333
336
  ignore_length = True
334
337
  skip_used_starts = False
@@ -355,9 +358,10 @@ class BaseAxes:
355
358
  current_line_seeds = _np.zeros(len(seeds), dtype=bool)
356
359
  nx_seed = int(10 * density)
357
360
  ny_seed = int(10 * density)
358
- dx_seed = domain_dx / nx_seed if domain_dx > 0 else 1.0
359
- dy_seed = domain_dy / ny_seed if domain_dy > 0 else 1.0
361
+ dx_seed = 1.0 / nx_seed
362
+ dy_seed = 1.0 / ny_seed
360
363
  R_SQ_THRESH = 0.0625
364
+ closed_loop_start_guard = 2 * _np.sqrt(R_SQ_THRESH) * max(dx_seed, dy_seed)
361
365
  def integrate_seed(start_point, maxlength=100.0, max_step=0.05, direction='both'):
362
366
  x0, y0 = start_point
363
367
  eps = 1e-8
@@ -369,7 +373,7 @@ class BaseAxes:
369
373
  return [vel_x / norm, vel_y / norm]
370
374
  def out_of_bounds_event(s, state):
371
375
  px, py = state
372
- return min(px - x_min, x_max - px, py - y_min, y_max - py)
376
+ return min(px, 1 - px, py, 1 - py)
373
377
  out_of_bounds_event.terminal = True # type: ignore
374
378
  out_of_bounds_event.direction = -1 # type: ignore
375
379
  def stagnation_event(s, state):
@@ -379,7 +383,7 @@ class BaseAxes:
379
383
  stagnation_event.terminal = True # type: ignore
380
384
  stagnation_event.direction = -1 # type: ignore
381
385
  def closed_loop_event(s, state):
382
- if abs(s) < 1.0:
386
+ if abs(s) < closed_loop_start_guard:
383
387
  return 1.0
384
388
  px, py = state
385
389
  dist_sq = ((px - x0) / dx_seed)**2 + ((py - y0) / dy_seed)**2
@@ -411,16 +415,44 @@ class BaseAxes:
411
415
  s_eval = _np.linspace(0.0, s_final, max(50, int(abs(s_final) * 50)))
412
416
  dense_pts = sol.sol(s_eval)
413
417
  x_pts, y_pts = dense_pts[0], dense_pts[1]
418
+ closed_at_seed = sol.t_events[2].size > 0
419
+ is_closed = closed_at_seed
420
+ if not is_closed:
421
+ cell_x = _np.sqrt(R_SQ_THRESH) * dx_seed
422
+ cell_y = _np.sqrt(R_SQ_THRESH) * dy_seed
423
+ min_loop_length = max(dx_seed, dy_seed)
424
+ visited = defaultdict(list)
425
+ for i, (px, py) in enumerate(zip(x_pts, y_pts)):
426
+ key = (int(px / cell_x), int(py / cell_y))
427
+ for gx in range(key[0] - 1, key[0] + 2):
428
+ for gy in range(key[1] - 1, key[1] + 2):
429
+ for j in visited.get((gx, gy), []):
430
+ if abs(s_eval[i] - s_eval[j]) < min_loop_length:
431
+ continue
432
+ dist_sq = ((px - x_pts[j]) / dx_seed)**2 + ((py - y_pts[j]) / dy_seed)**2
433
+ if dist_sq < R_SQ_THRESH:
434
+ x_pts = x_pts[j:i + 1]
435
+ y_pts = y_pts[j:i + 1]
436
+ x_pts[-1] = x_pts[0]
437
+ y_pts[-1] = y_pts[0]
438
+ is_closed = True
439
+ break
440
+ if is_closed:
441
+ break
442
+ if is_closed:
443
+ break
444
+ if is_closed:
445
+ break
446
+ visited[key].append(i)
447
+ if closed_at_seed:
448
+ x_pts = _np.append(x_pts, x0)
449
+ y_pts = _np.append(y_pts, y0)
414
450
  if mark_used:
415
451
  for px, py in zip(x_pts, y_pts):
416
452
  dist_sq = ((px - seeds[:, 0]) / dx_seed)**2 + ((py - seeds[:, 1]) / dy_seed)**2
417
453
  close_seeds = dist_sq < R_SQ_THRESH
418
454
  seed_used[close_seeds] = True
419
455
  current_line_seeds[close_seeds] = True
420
- is_closed = (sol.t_events[2].size > 0)
421
- if is_closed:
422
- x_pts = _np.append(x_pts, x0)
423
- y_pts = _np.append(y_pts, y0)
424
456
  return x_pts, y_pts, is_closed
425
457
  if direction == 'forward':
426
458
  return finalize_trajectory_and_mark(run_solver(maxlength))
@@ -433,7 +465,7 @@ class BaseAxes:
433
465
  return x_fwd, y_fwd, True
434
466
  fwd_pts = _np.column_stack([x_fwd, y_fwd]) if len(x_fwd) > 5 else None
435
467
  def hit_fwd_line_event(s, state):
436
- if fwd_pts is None or abs(s) < 1.0:
468
+ if fwd_pts is None or abs(s) < closed_loop_start_guard:
437
469
  return 1.0
438
470
  px, py = state
439
471
  dist_sq = ((px - fwd_pts[:, 0]) / dx_seed)**2 + ((py - fwd_pts[:, 1]) / dy_seed)**2
@@ -443,7 +475,15 @@ class BaseAxes:
443
475
  sol_bwd = run_solver(-maxlength, extra_events=[hit_fwd_line_event])
444
476
  x_bwd, y_bwd, is_closed_bwd = finalize_trajectory_and_mark(sol_bwd)
445
477
  hit_fwd_line = sol_bwd.t_events[4].size > 0 if len(sol_bwd.t_events) > 4 else False
446
- is_closed = is_closed_bwd or hit_fwd_line
478
+ if is_closed_bwd:
479
+ return x_bwd[::-1], y_bwd[::-1], True
480
+ if hit_fwd_line and fwd_pts is not None:
481
+ px, py = x_bwd[-1], y_bwd[-1]
482
+ dist_sq = ((px - fwd_pts[:, 0]) / dx_seed)**2 + ((py - fwd_pts[:, 1]) / dy_seed)**2
483
+ join_idx = int(_np.argmin(dist_sq))
484
+ x_fwd = x_fwd[:join_idx + 1]
485
+ y_fwd = y_fwd[:join_idx + 1]
486
+ is_closed = hit_fwd_line
447
487
  if len(x_bwd) > 0 and len(x_fwd) > 0:
448
488
  x_full = _np.concatenate([x_bwd[::-1], x_fwd[1:]])
449
489
  y_full = _np.concatenate([y_bwd[::-1], y_fwd[1:]])
@@ -472,7 +512,7 @@ class BaseAxes:
472
512
  grid_cell_size_y = dy_seed * 0.5
473
513
  spatial_grid = defaultdict(list)
474
514
  def get_grid_key(px, py):
475
- return int((px - x_min) / grid_cell_size_x), int((py - y_min) / grid_cell_size_y)
515
+ return int(px / grid_cell_size_x), int(py / grid_cell_size_y)
476
516
  def perp_dist(px, py, ax, ay, bx, by):
477
517
  npx, npy = px / dx_seed, py / dy_seed
478
518
  nax, nay = ax / dx_seed, ay / dy_seed
@@ -533,11 +573,14 @@ class BaseAxes:
533
573
  st = {}
534
574
  settings: dict[str, Any] = {"streamplot": {}}
535
575
  for x_seg, y_seg in final_streamlines:
576
+ x_plot = x_min + x_seg * (x_max - x_min)
577
+ y_plot = y_min + y_seg * (y_max - y_min)
536
578
  if cmap is not None:
537
- vs = _np.hypot(interp_u(_np.column_stack([x_seg, y_seg])), interp_v(_np.column_stack([x_seg, y_seg])))
538
- lines[0].append(list(zip(x_seg, y_seg, vs)))
579
+ points = _np.column_stack([x_seg, y_seg])
580
+ vs = _np.hypot(interp_u(points) * domain_dx, interp_v(points) * domain_dy)
581
+ lines[0].append(list(zip(x_plot, y_plot, vs)))
539
582
  else:
540
- lines[0].append(list(zip(x_seg, y_seg)))
583
+ lines[0].append(list(zip(x_plot, y_plot)))
541
584
  ol = None
542
585
  settings["empty line"] = "jump"
543
586
  if cmap is not None:
@@ -563,14 +606,10 @@ class BaseAxes:
563
606
  arrow_u = []
564
607
  arrow_v = []
565
608
  arrow_c = []
566
- scale_x = 1.0 / domain_dx if domain_dx > 0 else 1.0
567
- scale_y = 1.0 / domain_dy if domain_dy > 0 else 1.0
568
609
  for x_seg, y_seg in final_streamlines:
569
610
  if len(x_seg) < 2:
570
611
  continue
571
- dx_norm = _np.diff(x_seg) * scale_x
572
- dy_norm = _np.diff(y_seg) * scale_y
573
- step_lengths = _np.hypot(dx_norm, dy_norm)
612
+ step_lengths = _np.hypot(_np.diff(x_seg), _np.diff(y_seg))
574
613
  cum_len = _np.concatenate([[0.0], _np.cumsum(step_lengths)])
575
614
  total_len = cum_len[-1]
576
615
  if total_len == 0.0:
@@ -583,12 +622,12 @@ class BaseAxes:
583
622
  frac = (t_len - cum_len[idx]) / ds if ds > 0 else 0.0
584
623
  px = x_seg[idx] + frac * (x_seg[idx + 1] - x_seg[idx])
585
624
  py = y_seg[idx] + frac * (y_seg[idx + 1] - y_seg[idx])
586
- pu = float(interp_u((px, py)))
587
- pv = float(interp_v((px, py)))
625
+ pu = float(interp_u((px, py))) * domain_dx
626
+ pv = float(interp_v((px, py))) * domain_dy
588
627
  p_norm = _np.hypot(pu, pv)
589
628
  if p_norm > 1e-8:
590
- arrow_x.append(px)
591
- arrow_y.append(py)
629
+ arrow_x.append(x_min + px * (x_max - x_min))
630
+ arrow_y.append(y_min + py * (y_max - y_min))
592
631
  arrow_u.append(pu / p_norm)
593
632
  arrow_v.append(pv / p_norm)
594
633
  arrow_c.append(p_norm)
@@ -644,9 +683,9 @@ class BaseAxes:
644
683
  if "colors" in kwargs:
645
684
  colors = kwargs.pop("colors")
646
685
  if isinstance(colors, list):
647
- trgts = None if _np.isclose(_np.min(_np.diff(levels)), _np.max(_np.diff(levels))) else levels
686
+ #trgts = None if _np.isclose(_np.min(_np.diff(levels)), _np.max(_np.diff(levels))) else levels
648
687
  kwargs["cmap"] = colors
649
- cb = Colorbar(cmap=colors, lower=vmin, upper=vmax, targets=trgts)
688
+ cb = Colorbar(cmap=colors, lower=vmin, upper=vmax, targets=levels)
650
689
  else:
651
690
  cb = None
652
691
  kwargs["color"] = colors
@@ -883,7 +922,7 @@ class BaseAxes:
883
922
 
884
923
  stack = kwargs.pop("stacked", False)
885
924
  datas = {}
886
- for kw in ["color", "c", "facecolor", "fc", "edgecolor", "ec", "label", "hatch", "hatch_color", "hatch_linewidth", "hatch_distance"]:
925
+ for kw in ["alpha", "color", "c", "facecolor", "fc", "edgecolor", "ec", "label", "hatch", "hatch_color", "hatch_linewidth", "hatch_distance"]:
887
926
  if kw in kwargs:
888
927
  if isinstance(kwargs[kw], (list)):
889
928
  if len(kwargs[kw]) != len(datasets):
@@ -941,7 +980,7 @@ class BaseAxes:
941
980
  data = datasets[i]
942
981
  settings = base_settings.copy()
943
982
  kws = datas.get(i, {})
944
- passing_args = ["facecolor", "fc", "color", "c", "edgecolor", "ec", "label", "hatch", "hatch_color", "hatch_linewidth", "hatch_distance"]
983
+ passing_args = ["facecolor", "fc", "color", "c", "edgecolor", "ec", "label", "hatch", "hatch_color", "hatch_linewidth", "hatch_distance", "alpha"]
945
984
  for a in passing_args:
946
985
  if a in kws:
947
986
  settings[a] = kws[a]
@@ -1045,7 +1084,7 @@ class BaseAxes:
1045
1084
  except (ValueError, TypeError):
1046
1085
  h_arr = _np.asarray(heights)
1047
1086
  if h_arr.ndim == 2:
1048
- datasets = [col for col in h_arr.T]
1087
+ datasets = [h_arr[:, i] for i in range(h_arr.shape[1])] #pyright: ignore reportGeneralTypeIssues
1049
1088
  else:
1050
1089
  raise ValueError("Invalid dataset structure.")
1051
1090
  else:
@@ -1053,13 +1092,13 @@ class BaseAxes:
1053
1092
  if h_arr.ndim == 1:
1054
1093
  datasets = [h_arr]
1055
1094
  elif h_arr.ndim == 2:
1056
- datasets = [col for col in h_arr.T]
1095
+ datasets = [h_arr[:, i] for i in range(h_arr.shape[1])] #pyright: ignore reportGeneralTypeIssues
1057
1096
  else:
1058
1097
  raise ValueError(f"Input must be 1D or 2D, got {h_arr.ndim}D.")
1059
1098
 
1060
1099
  xs = kwargs.pop("positions", range(len(datasets)))
1061
- if len(xs) != len(datasets):
1062
- raise Warning("Length of positions does not match length of datasets.")
1100
+ if len(xs) != len(datasets[0]):
1101
+ raise Warning(f"Length of positions ({len(xs)}) does not match length of datasets ({len(datasets)}).")
1063
1102
  if _np.diff(xs).min() != _np.diff(xs).max():
1064
1103
  raise Warning("Positions must be equidistant.")
1065
1104
  dist = _np.diff(xs).min()
@@ -1196,6 +1235,17 @@ class BaseAxes:
1196
1235
  self._update_levels("ymin" if orientation == "vertical" else "xmin", min(m, 0))
1197
1236
  self._update_levels("ymax" if orientation == "vertical" else "xmax", M)
1198
1237
 
1238
+ is_polar = False ## Temporary fix, needs proper implementation to fix edges and alignment in general cases for polar plots.
1239
+ if isinstance(self, Axes):
1240
+ if self._projection=="polar": is_polar = True
1241
+ elif isinstance(self, Secondary):
1242
+ if self._primary._projection=="polar": is_polar = True
1243
+ if is_polar:
1244
+ k = _np.repeat(k, 3)[1:-1]
1245
+ v = _np.repeat(v, 3)[:-2]
1246
+ v[::3] = 0
1247
+ v[0] = 0
1248
+
1199
1249
  if _np.count_nonzero(edge) > 0:
1200
1250
  lower = self._get_overlay()
1201
1251
  if bar_type + " stacked" in self._overlay_special.get(lower, {}):
@@ -1234,6 +1284,9 @@ class BaseAxes:
1234
1284
 
1235
1285
  fill = kwargs.pop("facecolor", kwargs.pop("fc", kwargs.pop("color", kwargs.pop("c", None))))
1236
1286
  draw = kwargs.pop("edgecolor", kwargs.pop("ec", None))
1287
+ opacity = kwargs.pop("alpha", 1)
1288
+ if opacity != 1:
1289
+ element_args["alpha"] = opacity
1237
1290
  if fill:
1238
1291
  fill = self._match_color(fill)
1239
1292
  settings["fill"] = fill
@@ -1242,7 +1295,7 @@ class BaseAxes:
1242
1295
  settings["draw"] = draw
1243
1296
  else:
1244
1297
  settings["draw"] = "none"
1245
- for kw in ["label", "hatch", "hatch_color", "hatch_linewidth", "hatch_distance"]:
1298
+ for kw in ["label", "hatch", "hatch_color", "hatch_linewidth", "hatch_distance", "ecolor", "capsize"]:
1246
1299
  if kw in kwargs:
1247
1300
  element_args[kw] = kwargs.pop(kw)
1248
1301
  note = ",\n".join([self._parse_entry(k, v) for k, v in self._overlay_special.get(overlay, {}).items()]) if overlay in self._overlay_special else None
@@ -1252,6 +1305,10 @@ class BaseAxes:
1252
1305
  else:
1253
1306
  settings["xbar legend"] = None
1254
1307
  settings[bar_type] = None
1308
+ if is_polar:
1309
+ for q in ["ybar", "xbar", "ybar interval", "xbar interval"]:
1310
+ settings.pop(q, None)
1311
+ note = ""
1255
1312
  return self._plot(k, v, yerr=kwargs.get("yerr", None), xerr=kwargs.get("xerr", None), overlay=overlay, settings=settings, note=note, **element_args)
1256
1313
 
1257
1314
  def bar_label(self, container, labels=None, **kwargs):
@@ -1724,7 +1781,7 @@ class BaseAxes:
1724
1781
 
1725
1782
  def set_ylabel(self, label, **kwargs):
1726
1783
  self._not_hidable()
1727
- kws = {"fontsize", "color", "c", "loc", "rotate"}
1784
+ kws = {"fontsize", "color", "c", "loc", "rotation"}
1728
1785
  kwargs = self._check_kwargs("set_ylabel", kws, **kwargs)
1729
1786
  st = {}
1730
1787
  if "fontsize" in kwargs:
@@ -1751,12 +1808,17 @@ class BaseAxes:
1751
1808
  else:
1752
1809
  st["at"] = {}
1753
1810
  st["anchor"] = {}
1754
- if "rotate" in kwargs:
1755
- if kwargs["rotate"] not in ["vertical", "horizontal"]:
1756
- raise Warning(f"Invalid rotate: {kwargs['rotate']}. Must be one of 'vertical' or 'horizontal'.")
1757
- if kwargs["rotate"] == "horizontal":
1758
- if isinstance(self, Secondary):
1759
- st["rotate"] = "-90"
1811
+ if "rotation" in kwargs:
1812
+ if isinstance(kwargs["rotation"], (int, float)):
1813
+ st["rotate"] = str(kwargs["rotation"])
1814
+ elif isinstance(kwargs["rotation"], str):
1815
+ if kwargs["rotation"] not in ["vertical", "horizontal"]:
1816
+ raise Warning(f"Invalid rotation: {kwargs['rotation']}. Must be one of 'vertical' or 'horizontal'.")
1817
+ if kwargs["rotation"] == "horizontal":
1818
+ if isinstance(self, Secondary):
1819
+ st["rotate"] = "-90"
1820
+ else:
1821
+ st["rotate"] = "-90"
1760
1822
  else:
1761
1823
  st["rotate"] = "-90"
1762
1824
  else:
@@ -1800,11 +1862,13 @@ class BaseAxes:
1800
1862
  if "base" in kwargs:
1801
1863
  self._axis_options["log basis y"] = kwargs["base"]
1802
1864
 
1803
- def set_yticks(self, *ticks, labels=None, **kwargs):
1865
+ def set_yticks(self, *ticks, labels=None, scaled=None, **kwargs):
1804
1866
  pass_to_labels = {"rotation", "va", "verticalalignment", "ha", "horizontalalignment"}
1805
1867
  kws = {"color", "c", "fontsize"} | pass_to_labels
1806
1868
  kwargs = self._check_kwargs("set_yticks", kws, **kwargs)
1807
1869
  st = {}
1870
+ if scaled is not None:
1871
+ self._axis_options["scaled y ticks"] = "true" if scaled else "false"
1808
1872
  if "color" in kwargs or "c" in kwargs:
1809
1873
  c = kwargs.get("color", kwargs.get("c", None))
1810
1874
  st["text"] = self._match_color(c)
@@ -1818,14 +1882,14 @@ class BaseAxes:
1818
1882
  if ticks:
1819
1883
  if len(ticks) == 2:
1820
1884
  ticks, labels = ticks
1821
- elif len(ticks) == 1 and isinstance(ticks[0], (list, tuple)):
1822
- ticks = ticks[0]
1885
+ elif len(ticks) == 1 and isinstance(ticks[0], Iterable):
1886
+ ticks = list(ticks[0])
1823
1887
  else: raise Warning("Too many positional arguments for set_xticks. Expected 1 or 2.")
1824
1888
  if list(ticks) != []:
1825
1889
  s_ticks = map(str, ticks)
1826
1890
  self._axis_options["ytick"]=f"{{{','.join(s_ticks)}}}"
1827
1891
  if labels is not None and len(labels)==len(ticks):
1828
- self._axis_options["yticklabels"]=f"{{{tex_text(','.join (labels))}}}"
1892
+ self._axis_options["yticklabels"]=f"{{{tex_text(','.join(labels))}}}"
1829
1893
  elif labels is not None and len(labels) == 0:
1830
1894
  self._axis_options["yticklabels"]=r"{}"
1831
1895
  self._yticks = False
@@ -1877,13 +1941,14 @@ class BaseAxes:
1877
1941
  self._axis_options["yticklabels"]=f"{{{tex_text(','.join(labels[0]))}}}"
1878
1942
  else:
1879
1943
  self._axis_options["yticklabels"]=r"{}"
1944
+ self._axis_options["scaled y ticks"]="false"
1880
1945
  self._yticks = False
1881
1946
 
1882
1947
  def set_xlabel(self, label, **kwargs):
1883
1948
  if isinstance(self, Secondary):
1884
1949
  return self._primary.set_xlabel(label, **kwargs)
1885
1950
  self._not_hidable()
1886
- kws = {"fontsize", "color", "c", "loc", "rotate"}
1951
+ kws = {"fontsize", "color", "c", "loc", "rotation"}
1887
1952
  kwargs = self._check_kwargs("set_xlabel", kws, **kwargs)
1888
1953
  st = {}
1889
1954
  if "fontsize" in kwargs:
@@ -1904,11 +1969,14 @@ class BaseAxes:
1904
1969
  else:
1905
1970
  st["at"] = {}
1906
1971
  st["anchor"] = {}
1907
- if "rotate" in kwargs:
1908
- if kwargs["rotate"] not in ["vertical", "horizontal"]:
1909
- raise Warning(f"Invalid rotate: {kwargs['rotate']}. Must be one of 'vertical' or 'horizontal'.")
1910
- if kwargs["rotate"] == "vertical":
1911
- st["rotate"] = "-90"
1972
+ if "rotation" in kwargs:
1973
+ if isinstance(kwargs["rotation"], (int, float)):
1974
+ st["rotate"] = str(kwargs["rotation"])
1975
+ elif isinstance(kwargs["rotation"], str):
1976
+ if kwargs["rotation"] not in ["vertical", "horizontal"]:
1977
+ raise Warning(f"Invalid rotation: {kwargs['rotation']}. Must be one of 'vertical' or 'horizontal'.")
1978
+ if kwargs["rotation"] == "vertical":
1979
+ st["rotate"] = "-90"
1912
1980
  else:
1913
1981
  st["rotate"] = {}
1914
1982
  if "\n" in label:
@@ -2021,12 +2089,14 @@ class BaseAxes:
2021
2089
  if "base" in kwargs:
2022
2090
  self._axis_options["log basis x"] = kwargs["base"]
2023
2091
 
2024
- def set_xticks(self, *ticks, labels=None, **kwargs):
2092
+ def set_xticks(self, *ticks, labels=None, scaled=None, **kwargs):
2025
2093
  if isinstance(self, Secondary):
2026
2094
  return self._primary.set_xticks(*ticks, labels=labels, **kwargs)
2027
2095
  pass_to_labels = {"rotation", "ha", "horizontalalignment", "va", "verticalalignment"}
2028
2096
  kws = {"color", "c", "fontsize"} | pass_to_labels
2029
2097
  kwargs = self._check_kwargs("set_xticks", kws, **kwargs)
2098
+ if scaled is not None:
2099
+ self._axis_options["scaled x ticks"] = "true" if scaled else "false"
2030
2100
  st = {}
2031
2101
  if "color" in kwargs or "c" in kwargs:
2032
2102
  c = kwargs.get("color", kwargs.get("c", None))
@@ -2041,8 +2111,8 @@ class BaseAxes:
2041
2111
  if ticks:
2042
2112
  if len(ticks) == 2:
2043
2113
  ticks, labels = ticks
2044
- elif len(ticks) == 1 and isinstance(ticks[0], (list, tuple)):
2045
- ticks = ticks[0]
2114
+ elif len(ticks) == 1 and isinstance(ticks[0], Iterable):
2115
+ ticks = list(ticks[0])
2046
2116
  else: raise Warning("Too many positional arguments for set_xticks. Expected 1 or 2.")
2047
2117
  if list(ticks) != []:
2048
2118
  s_ticks = map(str, ticks)
@@ -2102,9 +2172,9 @@ class BaseAxes:
2102
2172
  self._axis_options["xticklabels"]=f"{{{tex_text(','.join(labels[0]))}}}"
2103
2173
  else:
2104
2174
  self._axis_options["xticklabels"]=r"{}"
2175
+ self._axis_options["scaled x ticks"]="false"
2105
2176
  self._xticks = False
2106
2177
 
2107
-
2108
2178
  def tick_params(self, axis="both", **kwargs):
2109
2179
  kws = {"color", "c", "labelsize", "labelcolor", "colors", "direction", "top", "bottom", "left", "right", "labelbottom", "labelleft"}
2110
2180
  kwargs = self._check_kwargs("tick_params", kws, **kwargs)
@@ -2174,7 +2244,7 @@ class BaseAxes:
2174
2244
  elif self._axis_options["ytick pos"] == "none":
2175
2245
  self._update_axis_options("ytick style", {"draw": self._axis_options.pop("ytick pos")})
2176
2246
 
2177
- _LEGEND_LOC_MAP = ["best", "upper right", "upper left", "lower_left", "lower right", "right", "center left", "center right", "lower center", "upper center", "center"]
2247
+ _LEGEND_LOC_MAP = ["best", "upper right", "upper left", "lower left", "lower right", "right", "center left", "center right", "lower center", "upper center", "center"]
2178
2248
  _ANCHOR_MAP = {"top": "north", "bottom": "south", "upper": "north", "lower": "south", "left": "west", "right": "east", "center": "center"}
2179
2249
  _FONT_SIZE_MAP = {"xx-small": "tiny", "x-small": "scriptsize", "small": "footnotesize", "medium": "small", "large": "normalsize", "x-large": "large", "xx-large": "Large"}
2180
2250
 
@@ -3104,6 +3174,7 @@ class Axes(BaseAxes):
3104
3174
  axis_opt_str[i] += entry
3105
3175
  if TikzConfig.SCHOOL_AXIS:
3106
3176
  axis_opt_str[1] += f",\n axis lines=middle,\n xlabel style={{at={{(ticklabel* cs:{1+TikzConfig.SCHOOL_AXIS_LABEL_MARGIN})}},anchor=north}},\n ylabel style={{at={{(ticklabel* cs:{1+TikzConfig.SCHOOL_AXIS_LABEL_MARGIN})}},anchor=east}}"
3177
+ axis_opt_str[2] += f",\n axis lines=middle,\n xlabel style={{at={{(ticklabel* cs:{1+TikzConfig.SCHOOL_AXIS_LABEL_MARGIN})}},anchor=north}},\n ylabel style={{at={{(ticklabel* cs:{1+TikzConfig.SCHOOL_AXIS_LABEL_MARGIN})}},anchor=east}}"
3107
3178
  if ("xmin" in self._axis_options and self._axis_options["xmin"] == 0) or ("xmax" in self._axis_options and self._axis_options["xmax"] == 0):
3108
3179
  self._axis_options["extra x ticks"] = r"{0}"
3109
3180
  if ("ymin" in self._axis_options and self._axis_options["ymin"] == 0) or ("ymax" in self._axis_options and self._axis_options["ymax"] == 0):
@@ -145,10 +145,10 @@ class BaseAxes:
145
145
  Size of arrows along streamlines. Default is 1.0.
146
146
 
147
147
  minlength: float, optional
148
- Minimum length of streamlines. Streamlines shorter than this will be discarded. Default is 0.1.
148
+ Minimum length of streamlines (relative, where 1 is the dimension of the domain). Streamlines shorter than this will be discarded. Default is 0.1.
149
149
 
150
150
  maxlength: float, optional
151
- Maximum length of streamlines. Streamlines longer than this will be truncated. Default is 4.0.
151
+ Maximum length of streamlines (relative, where 1 is the dimension of the domain). Streamlines longer than this will be truncated. Default is 4.0.
152
152
 
153
153
  integration_direction: {"forward", "backward", "both"}, optional
154
154
  Direction of integration for streamlines. Default is "both".
@@ -479,19 +479,19 @@ class BaseAxes:
479
479
  rwidth: float | None = None,
480
480
  range: Tuple[float,float] | None = None,
481
481
  alpha: float = 1.0,
482
- color: ColorLike | Sequence[ColorLike] = ...,
483
- facecolor: ColorLike | Sequence[ColorLike] = ...,
484
- fc: ColorLike | Sequence[ColorLike] = ...,
485
- edgecolor: ColorLike | Sequence[ColorLike] = ...,
486
- ec: ColorLike | Sequence[ColorLike] = ...,
487
- align: Literal["left", "mid", "right"] = ...,
482
+ color: ColorLike | Sequence[ColorLike]|None = ...,
483
+ facecolor: ColorLike | Sequence[ColorLike]|None = ...,
484
+ fc: ColorLike | Sequence[ColorLike]|None = ...,
485
+ edgecolor: ColorLike | Sequence[ColorLike]|None = ...,
486
+ ec: ColorLike | Sequence[ColorLike]|None = ...,
487
+ align: Literal["left", "mid", "right"]|None = ...,
488
488
  stacked: bool = False,
489
489
  fill: bool = True,
490
- hatch: str|Sequence[str] = ...,
491
- hatch_color: ColorLike|Sequence[ColorLike] = ...,
492
- hatch_linewidth: float|Sequence[float] = ...,
493
- hatch_distance: float|Sequence[float] = ...,
494
- label: Optional[str|Sequence[str]] = ...,
490
+ hatch: str|Sequence[str]|None = ...,
491
+ hatch_color: ColorLike|Sequence[ColorLike]|None = ...,
492
+ hatch_linewidth: float|Sequence[float]|None = ...,
493
+ hatch_distance: float|Sequence[float]|None = ...,
494
+ label: Optional[str|Sequence[str]]|None = ...,
495
495
  #**kwargs: Any
496
496
  ) -> Sequence[Graph]:
497
497
  """
@@ -1863,7 +1863,7 @@ class BaseAxes:
1863
1863
  """
1864
1864
  ...
1865
1865
 
1866
- def set_ylabel(self, label: str, fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., loc: Literal["top", "center", "bottom"] = ..., rotate: Literal["vertical", "horizontal"] = ...) -> None:
1866
+ def set_ylabel(self, label: str, fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., loc: Literal["top", "center", "bottom"] = ..., rotation: Literal["vertical", "horizontal"]|float|int|None = ...) -> None:
1867
1867
  """
1868
1868
  Set y-axis label.
1869
1869
 
@@ -1881,8 +1881,8 @@ class BaseAxes:
1881
1881
  loc: {"top", "center", "bottom"}, optional
1882
1882
  Location of label, default center
1883
1883
 
1884
- rotate: {"vertical", "horizontal"}, optional
1885
- Rotation of label, default vertical
1884
+ rotation: {"vertical", "horizontal"}, int or float, optional
1885
+ Rotation of label, default vertical. Angle in degrees from default position.
1886
1886
  """
1887
1887
  ...
1888
1888
  def set_ylim(self, *args: Any, bottom: Optional[float] = ..., top: Optional[float] = ...) -> None:
@@ -1896,7 +1896,7 @@ class BaseAxes:
1896
1896
  Set y-axis scale (to log).
1897
1897
  """
1898
1898
  ...
1899
- def set_yticks(self, *ticks: ArrayLike, labels: Optional[Sequence[str]] = ..., fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., rotation: Optional[float|int]= ..., ha: Optional[Literal["left", "center", "right"]] = ..., horizontalalignment: Optional[Literal["left", "center", "right"]] = ..., va: Optional[Literal["top", "center", "bottom"]] = ..., verticalalignment: Optional[Literal["top", "center", "bottom"]] = ...) -> None:
1899
+ def set_yticks(self, *ticks: ArrayLike, labels: Optional[Sequence[str]] = ..., scaled: Optional[bool] = ..., fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., rotation: Optional[float|int]= ..., ha: Optional[Literal["left", "center", "right"]] = ..., horizontalalignment: Optional[Literal["left", "center", "right"]] = ..., va: Optional[Literal["top", "center", "bottom"]] = ..., verticalalignment: Optional[Literal["top", "center", "bottom"]] = ...) -> None:
1900
1900
  """
1901
1901
  Set y-axis ticks and their labels.
1902
1902
 
@@ -1908,6 +1908,9 @@ class BaseAxes:
1908
1908
  labels: sequence of str, optional
1909
1909
  Tick labels, if not provided, the tick positions are used as labels
1910
1910
 
1911
+ scaled: bool, optional
1912
+ If False, automatic tick labels will be written without scale factor (e.g., 1e-3). If unchanged, LateX default is used.
1913
+
1911
1914
  fontsize: FontSize or int, optional
1912
1915
  Font size of tick labels
1913
1916
 
@@ -1950,7 +1953,7 @@ class BaseAxes:
1950
1953
  """
1951
1954
  ...
1952
1955
 
1953
- def set_xlabel(self, label: str, fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., loc: Optional[Literal["left", "center", "right"]] = ...) -> None:
1956
+ def set_xlabel(self, label: str, fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., loc: Optional[Literal["left", "center", "right"]] = ..., rotation: Optional[Literal["vertical", "horizontal"]]|float|int|None = ...) -> None:
1954
1957
  """
1955
1958
  Set x-axis label.
1956
1959
 
@@ -1967,6 +1970,9 @@ class BaseAxes:
1967
1970
 
1968
1971
  loc: {"left", "center", "right"}, optional
1969
1972
  Label location, default "center"
1973
+
1974
+ rotation: {"vertical", "horizontal"}, int or float, optional
1975
+ Rotation of label, default horizontal. Angle in degrees from default position.
1970
1976
  """
1971
1977
  ...
1972
1978
  def set_title(self, title: str, fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., loc: Optional[Literal["left", "center", "right"]] = ...) -> None:
@@ -2029,7 +2035,7 @@ class BaseAxes:
2029
2035
  Set x-axis scale (to log).
2030
2036
  """
2031
2037
  ...
2032
- def set_xticks(self, *ticks: ArrayLike, labels: Optional[Sequence[str]] = ..., fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., rotation: Optional[float|int]= ..., ha: Optional[Literal["left", "center", "right"]] = ..., horizontalalignment: Optional[Literal["left", "center", "right"]] = ..., va: Optional[Literal["top", "center", "bottom"]] = ..., verticalalignment: Optional[Literal["top", "center", "bottom"]] = ...) -> None:
2038
+ def set_xticks(self, *ticks: ArrayLike, labels: Optional[Sequence[str]] = ..., scaled: Optional[bool] = ..., fontsize: Optional[FontSize] = ..., color: Optional[ColorLike] = ..., c: Optional[ColorLike] = ..., rotation: Optional[float|int]= ..., ha: Optional[Literal["left", "center", "right"]] = ..., horizontalalignment: Optional[Literal["left", "center", "right"]] = ..., va: Optional[Literal["top", "center", "bottom"]] = ..., verticalalignment: Optional[Literal["top", "center", "bottom"]] = ...) -> None:
2033
2039
  """
2034
2040
  Set x-axis ticks and their labels.
2035
2041
 
@@ -2041,6 +2047,9 @@ class BaseAxes:
2041
2047
  labels: sequence of str, optional
2042
2048
  Labels for the ticks. If not provided, the tick positions will be used as labels.
2043
2049
 
2050
+ scaled: bool, optional
2051
+ If False, automatic tick labels will be written without scale factor (e.g., 1e-3). If unchanged, LaTeX default is used.
2052
+
2044
2053
  fontsize: FontSize, optional
2045
2054
  Font size of the tick labels.
2046
2055
 
@@ -2116,7 +2125,7 @@ class BaseAxes:
2116
2125
  """
2117
2126
  ...
2118
2127
 
2119
- def legend(self, *args: Any, loc: Optional[Union[int,str,Tuple[float,float]]] = ..., facecolor: Optional[ColorLike] = ..., edgecolor: Optional[ColorLike] = ..., labelcolor: Optional[ColorLike] = ..., frameon: Optional[bool] = ..., anchor: Optional[Literal["north", "south", "east", "west", "center", "north west", "north east", "south west", "south east"]] = ..., fontsize: Optional[Literal["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"] | int] = ..., ncols: Optional[int] = 1, reverse: Optional[bool] = False) -> None:
2128
+ def legend(self, *args: Any, loc: Optional[Union[int,Literal["upper right", "upper left", "lower left", "lower right", "right", "center left", "center right", "lower center", "upper center", "center"],Tuple[float,float]]] = ..., facecolor: Optional[ColorLike] = ..., edgecolor: Optional[ColorLike] = ..., labelcolor: Optional[ColorLike] = ..., frameon: Optional[bool] = ..., anchor: Optional[Literal["north", "south", "east", "west", "center", "north west", "north east", "south west", "south east"]] = ..., fontsize: Optional[Literal["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"] | int] = ..., ncols: Optional[int] = 1, reverse: Optional[bool] = False) -> None:
2120
2129
  """
2121
2130
  Show legend for the selected axis. Despite arguments requires at least one plotted element on the axis (not necesarily with label) to show up (LaTeX does not allow legend on empty axis).
2122
2131