IBB-Helper 0.4.8.dev12__tar.gz → 0.4.8.dev14__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 (24) hide show
  1. {ibb_helper-0.4.8.dev12/src/IBB_Helper.egg-info → ibb_helper-0.4.8.dev14}/PKG-INFO +1 -1
  2. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/pyproject.toml +1 -1
  3. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/plot_2d.py +64 -29
  4. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14/src/IBB_Helper.egg-info}/PKG-INFO +1 -1
  5. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/LICENSE +0 -0
  6. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/README.md +0 -0
  7. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/setup.cfg +0 -0
  8. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/setup.py +0 -0
  9. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/__init__.py +0 -0
  10. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/animate.py +0 -0
  11. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/combine_plots.py +0 -0
  12. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/display.py +0 -0
  13. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/display_eigen.py +0 -0
  14. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/display_matrix.py +0 -0
  15. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/extend_plot.py +0 -0
  16. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/minimize.py +0 -0
  17. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/num_int.py +0 -0
  18. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/plot_3d.py +0 -0
  19. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/plot_param_grid.py +0 -0
  20. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/symbolic_BSpline.py +0 -0
  21. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/SOURCES.txt +0 -0
  22. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/dependency_links.txt +0 -0
  23. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/requires.txt +0 -0
  24. {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IBB_Helper
3
- Version: 0.4.8.dev12
3
+ Version: 0.4.8.dev14
4
4
  Summary: Helper functions for symbolic math, matrix visualization, and plotting
5
5
  Author-email: "University of Stuttgart, Institute for Structural Mechanics (IBB)" <mvs@ibb.uni-stuttgart.de>
6
6
  License-Expression: BSD-3-Clause
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "IBB_Helper"
7
- version = "0.4.8.dev12"
7
+ version = "0.4.8.dev14"
8
8
  description = "Helper functions for symbolic math, matrix visualization, and plotting"
9
9
  readme = "README.md"
10
10
  license = "BSD-3-Clause"
@@ -3,9 +3,12 @@ import sympy as sp
3
3
  import matplotlib.pyplot as plt
4
4
  from sympy import latex, Matrix
5
5
 
6
- def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
7
- xlabel="x",ylabel="y",xlim=None,ylim=None,resolution=400,show=True,_break_=None,
8
- fontsize=14,title_size=None,label_size=None,tick_size=None,legend_size=None,linewidth=2):
6
+ def plot_2d(exprs, var, labels=None, line_styles=None, colors=None,
7
+ title="2D Plot", xlabel="x", ylabel="y",
8
+ xlim=None, ylim=None, resolution=400, show=True, _break_=None,
9
+ fontsize=14, title_size=None, label_size=None,
10
+ tick_size=None, legend_size=None, linewidth=2,
11
+ swap_axes=False,scaling=None):
9
12
 
10
13
  """
11
14
  Plots 2D curves from symbolic expressions or numeric datasets using Matplotlib.
@@ -29,13 +32,14 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
29
32
  label_size : Font size for axis labels (default=None → fontsize)
30
33
  tick_size : Font size for tick labels (default=None → fontsize-2)
31
34
  legend_size : Font size for legend text (default=None → tick_size)
35
+ swap_axes : If True, swaps x and y axes (default=False)
36
+ scaling : 'constrained'→ equal axis units(default=None)
32
37
 
33
38
  Returns:
34
39
  matplotlib Axes
35
40
  The generated 2D plot axes
36
41
  """
37
42
 
38
-
39
43
  # Font size defaults
40
44
  title_size = title_size or fontsize + 2
41
45
  label_size = label_size or fontsize
@@ -122,15 +126,24 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
122
126
  marker = style
123
127
  style = ''
124
128
 
125
- ax.plot(
126
- x_data,
127
- y_data,
128
- label=label,
129
- linestyle=style,
130
- color=color,
131
- marker=marker,
132
- linewidth=linewidth
133
- )
129
+ if swap_axes:
130
+ ax.plot(
131
+ y_data, x_data,
132
+ label=label,
133
+ linestyle=style,
134
+ color=color,
135
+ marker=marker,
136
+ linewidth=linewidth
137
+ )
138
+ else:
139
+ ax.plot(
140
+ x_data, y_data,
141
+ label=label,
142
+ linestyle=style,
143
+ color=color,
144
+ marker=marker,
145
+ linewidth=linewidth
146
+ )
134
147
 
135
148
  # Standard y = f(x)
136
149
  else:
@@ -146,27 +159,49 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
146
159
  if original_expr in _break_:
147
160
  y_vals = _break_kinks(y_vals)
148
161
 
149
- ax.plot(
150
- x_vals_sample,
151
- y_vals,
152
- label=label,
153
- linestyle=style,
154
- color=color,
155
- linewidth=linewidth
156
- )
162
+ if swap_axes:
163
+ ax.plot(
164
+ y_vals, x_vals_sample,
165
+ label=label,
166
+ linestyle=style,
167
+ color=color,
168
+ linewidth=linewidth
169
+ )
170
+ else:
171
+ ax.plot(
172
+ x_vals_sample, y_vals,
173
+ label=label,
174
+ linestyle=style,
175
+ color=color,
176
+ linewidth=linewidth
177
+ )
157
178
 
158
179
  # Styling & Labels
159
180
  ax.set_title(smart_label(title), fontsize=title_size)
160
- ax.set_xlabel(smart_label(xlabel), fontsize=label_size)
161
- ax.set_ylabel(smart_label(ylabel), fontsize=label_size)
162
181
 
163
- ax.tick_params(axis='both', labelsize=tick_size)
182
+ if swap_axes:
183
+ ax.set_xlabel(smart_label(ylabel), fontsize=label_size)
184
+ ax.set_ylabel(smart_label(xlabel), fontsize=label_size)
185
+ else:
186
+ ax.set_xlabel(smart_label(xlabel), fontsize=label_size)
187
+ ax.set_ylabel(smart_label(ylabel), fontsize=label_size)
164
188
 
165
- if xlim:
166
- ax.set_xlim(xlim)
167
- if ylim:
168
- ax.set_ylim(ylim)
189
+ ax.tick_params(axis='both', labelsize=tick_size)
169
190
 
191
+ if swap_axes:
192
+ if ylim:
193
+ ax.set_xlim(ylim)
194
+ if xlim:
195
+ ax.set_ylim(xlim)
196
+ else:
197
+ if xlim:
198
+ ax.set_xlim(xlim)
199
+ if ylim:
200
+ ax.set_ylim(ylim)
201
+
202
+ if scaling == 'constrained':
203
+ ax.set_aspect('equal', adjustable='box')
204
+
170
205
  if labels:
171
206
  ax.legend(fontsize=legend_size)
172
207
 
@@ -177,4 +212,4 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
177
212
  else:
178
213
  plt.close()
179
214
 
180
- return ax
215
+ return ax
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IBB_Helper
3
- Version: 0.4.8.dev12
3
+ Version: 0.4.8.dev14
4
4
  Summary: Helper functions for symbolic math, matrix visualization, and plotting
5
5
  Author-email: "University of Stuttgart, Institute for Structural Mechanics (IBB)" <mvs@ibb.uni-stuttgart.de>
6
6
  License-Expression: BSD-3-Clause