IBB-Helper 0.4.8.dev11__tar.gz → 0.4.8.dev13__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.dev11/src/IBB_Helper.egg-info → ibb_helper-0.4.8.dev13}/PKG-INFO +1 -1
  2. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/pyproject.toml +1 -1
  3. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/plot_2d.py +59 -27
  4. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13/src/IBB_Helper.egg-info}/PKG-INFO +1 -1
  5. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/LICENSE +0 -0
  6. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/README.md +0 -0
  7. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/setup.cfg +0 -0
  8. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/setup.py +0 -0
  9. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/__init__.py +0 -0
  10. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/animate.py +0 -0
  11. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/combine_plots.py +0 -0
  12. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/display.py +0 -0
  13. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/display_eigen.py +0 -0
  14. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/display_matrix.py +0 -0
  15. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/extend_plot.py +0 -0
  16. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/minimize.py +0 -0
  17. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/num_int.py +0 -0
  18. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/plot_3d.py +0 -0
  19. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/plot_param_grid.py +0 -0
  20. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper/symbolic_BSpline.py +0 -0
  21. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper.egg-info/SOURCES.txt +0 -0
  22. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper.egg-info/dependency_links.txt +0 -0
  23. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/src/IBB_Helper.egg-info/requires.txt +0 -0
  24. {ibb_helper-0.4.8.dev11 → ibb_helper-0.4.8.dev13}/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.dev11
3
+ Version: 0.4.8.dev13
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.dev11"
7
+ version = "0.4.8.dev13"
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):
9
12
 
10
13
  """
11
14
  Plots 2D curves from symbolic expressions or numeric datasets using Matplotlib.
@@ -29,13 +32,13 @@ 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)
32
36
 
33
37
  Returns:
34
38
  matplotlib Axes
35
39
  The generated 2D plot axes
36
40
  """
37
41
 
38
-
39
42
  # Font size defaults
40
43
  title_size = title_size or fontsize + 2
41
44
  label_size = label_size or fontsize
@@ -122,15 +125,24 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
122
125
  marker = style
123
126
  style = ''
124
127
 
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
- )
128
+ if swap_axes:
129
+ ax.plot(
130
+ y_data, x_data,
131
+ label=label,
132
+ linestyle=style,
133
+ color=color,
134
+ marker=marker,
135
+ linewidth=linewidth
136
+ )
137
+ else:
138
+ ax.plot(
139
+ x_data, y_data,
140
+ label=label,
141
+ linestyle=style,
142
+ color=color,
143
+ marker=marker,
144
+ linewidth=linewidth
145
+ )
134
146
 
135
147
  # Standard y = f(x)
136
148
  else:
@@ -146,25 +158,45 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
146
158
  if original_expr in _break_:
147
159
  y_vals = _break_kinks(y_vals)
148
160
 
149
- ax.plot(
150
- x_vals_sample,
151
- y_vals,
152
- label=label,
153
- linestyle=style,
154
- color=color
155
- )
161
+ if swap_axes:
162
+ ax.plot(
163
+ y_vals, x_vals_sample,
164
+ label=label,
165
+ linestyle=style,
166
+ color=color,
167
+ linewidth=linewidth
168
+ )
169
+ else:
170
+ ax.plot(
171
+ x_vals_sample, y_vals,
172
+ label=label,
173
+ linestyle=style,
174
+ color=color,
175
+ linewidth=linewidth
176
+ )
156
177
 
157
178
  # Styling & Labels
158
179
  ax.set_title(smart_label(title), fontsize=title_size)
159
- ax.set_xlabel(smart_label(xlabel), fontsize=label_size)
160
- ax.set_ylabel(smart_label(ylabel), fontsize=label_size)
180
+
181
+ if swap_axes:
182
+ ax.set_xlabel(smart_label(ylabel), fontsize=label_size)
183
+ ax.set_ylabel(smart_label(xlabel), fontsize=label_size)
184
+ else:
185
+ ax.set_xlabel(smart_label(xlabel), fontsize=label_size)
186
+ ax.set_ylabel(smart_label(ylabel), fontsize=label_size)
161
187
 
162
188
  ax.tick_params(axis='both', labelsize=tick_size)
163
189
 
164
- if xlim:
165
- ax.set_xlim(xlim)
166
- if ylim:
167
- ax.set_ylim(ylim)
190
+ if swap_axes:
191
+ if ylim:
192
+ ax.set_xlim(ylim)
193
+ if xlim:
194
+ ax.set_ylim(xlim)
195
+ else:
196
+ if xlim:
197
+ ax.set_xlim(xlim)
198
+ if ylim:
199
+ ax.set_ylim(ylim)
168
200
 
169
201
  if labels:
170
202
  ax.legend(fontsize=legend_size)
@@ -176,4 +208,4 @@ def plot_2d(exprs,var,labels=None,line_styles=None,colors=None,title="2D Plot",
176
208
  else:
177
209
  plt.close()
178
210
 
179
- return ax
211
+ return ax
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IBB_Helper
3
- Version: 0.4.8.dev11
3
+ Version: 0.4.8.dev13
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