matmalib 0.2.2__tar.gz → 0.2.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matmalib
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,3 @@
1
- from turtle import color
2
-
3
1
  import matplotlib
4
2
  import numpy as np
5
3
  import matplotlib.pyplot as plt
@@ -382,7 +380,7 @@ class Plot():
382
380
  # plot = ax.contourf(x_edges[:-1], y_edges[:-1], Hall.T, cmap=cmap, zorder=1, levels=num_levels)
383
381
 
384
382
  cb_ticks = np.linspace(vmin, vmax, 6)
385
- cb = fig.colorbar(plot, ax=ax, ticks=cb_ticks, pad=0.05, shrink=0.78)
383
+ cb = fig.colorbar(plot, ax=ax, ticks=cb_ticks, pad=0.05, shrink=0.6)
386
384
  cb.ax.set_yticklabels([f"{tick:.1f}" for tick in cb_ticks], fontsize=12)
387
385
  cb.set_label("\n Free energy [kJ]", fontsize=14)
388
386
 
@@ -408,8 +406,13 @@ class Plot():
408
406
  :param limit: (Int) The upper limit on your energy scale
409
407
  """
410
408
 
411
- self.path = xpm_data_list[0].path
412
- limit = limit
409
+ if not isinstance(xpm_data_list, list):
410
+ xpm_data_list = [xpm_data_list]
411
+
412
+ if len(xpm_data_list) == 1:
413
+ self.path = xpm_data_list[0].path
414
+ else:
415
+ self.path = xpm_data_list[0].path
413
416
 
414
417
  Mat = []
415
418
 
@@ -440,38 +443,36 @@ class Plot():
440
443
  fig, axes = plt.subplots(1, len(Mat), figsize=(4 * len(Mat) + (len(Mat) - 1) * 1, 4), sharex=True, sharey=True)
441
444
  # fig, axes = plt.subplots(1,len(Mat), figsize=(4*len(Mat) + 1.5, 4), sharex=True, sharey=True)
442
445
 
443
- color_bar = ['Blues_r'] * len(Mat)
444
- color = self.colors
445
- color.reverse()
446
- cmap = ListedColormap(color)
447
-
448
446
  levels = np.linspace(0, limit, 9) # 8 levels between 0 and limit
447
+ if len(Mat) > 1:
448
+ for n, ax in enumerate(axes):
449
+
450
+ self.set_axes(ax)
451
+ dx = ax.get_xlim()[1] - ax.get_xlim()[0]
452
+ dy = ax.get_ylim()[1] - ax.get_ylim()[0]
449
453
 
450
- for n, ax in enumerate(axes):
451
- ax.set_aspect('equal', adjustable='box')
452
- ax.grid(True, ls='--', zorder=10.0)
454
+ ax.set_aspect(dx/dy, adjustable='box')
455
+ ax.grid(True, ls='--', zorder=10.0)
453
456
 
454
- # Set x-axis ticks and labels
455
- xmin, xmax = -180.0, 180.0
456
- xticks = np.linspace(xmin, xmax, 7)
457
- ax.set_xticks(np.linspace(0, 71, 7))
458
- ax.set_xticklabels(['{0:d}'.format(int(x)) for x in xticks], fontsize=12)
459
- ax.set_xlabel(r'$\phi$', fontsize=14)
457
+ # Create the contourf plot with consistent levels
458
+ plot = ax.contourf(Mat[n], levels=levels, colors=self.colors, zorder=1)
460
459
 
461
- # Set y-axis ticks and labels
462
- ymin, ymax = -180.0, 180.0
463
- yticks = np.linspace(ymax, ymin, 7)[::-1]
464
- ax.set_yticks(np.linspace(0, 71, 7))
465
- ax.set_yticklabels(['{0:d}'.format(int(x)) for x in yticks], fontsize=12)
460
+ # Add a color bar with consistent boundaries and ticks
461
+ cb = fig.colorbar(plot, ax=ax, pad=0.025, aspect=20, ticks=levels, shrink=0.7)
462
+ cb.set_ticklabels(["{0:3.1f}".format(x) for x in levels])
463
+ else:
464
+ self.set_axes(axes)
465
+ dx = axes.get_xlim()[1] - axes.get_xlim()[0]
466
+ dy = axes.get_ylim()[1] - axes.get_ylim()[0]
466
467
 
467
- if n == 0:
468
- ax.set_ylabel(r'$\psi$', fontsize=14)
468
+ axes.set_aspect(dx / dy, adjustable='box')
469
+ axes.grid(True, ls='--', zorder=10.0)
469
470
 
470
471
  # Create the contourf plot with consistent levels
471
- plot = ax.contourf(Mat[n], levels=levels, cmap=cmap, zorder=1)
472
+ plot = axes.contourf(Mat[0], levels=levels, colors=self.colors, zorder=1)
472
473
 
473
474
  # Add a color bar with consistent boundaries and ticks
474
- cb = fig.colorbar(plot, ax=ax, pad=0.025, aspect=20, ticks=levels)
475
+ cb = fig.colorbar(plot, ax=axes, pad=0.025, aspect=20, ticks=levels, shrink=0.7)
475
476
  cb.set_ticklabels(["{0:3.1f}".format(x) for x in levels])
476
477
 
477
478
  fig.tight_layout()
@@ -750,4 +751,4 @@ class Plot():
750
751
  plt.ylabel(f"{quant} (Ha)")
751
752
  plt.xlabel('conformer id')
752
753
 
753
- self.set_axes(ax)
754
+ self.set_axes(ax)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matmalib
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "matmalib"
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
 
8
8
  [tool.bumpversion]
9
- current_version = "0.2.2"
9
+ current_version = "0.2.4"
10
10
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
11
11
  serialize = ["{major}.{minor}.{patch}"]
12
12
  search = "{current_version}"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes