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.
- {ibb_helper-0.4.8.dev12/src/IBB_Helper.egg-info → ibb_helper-0.4.8.dev14}/PKG-INFO +1 -1
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/pyproject.toml +1 -1
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/plot_2d.py +64 -29
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14/src/IBB_Helper.egg-info}/PKG-INFO +1 -1
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/LICENSE +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/README.md +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/setup.cfg +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/setup.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/__init__.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/animate.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/combine_plots.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/display.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/display_eigen.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/display_matrix.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/extend_plot.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/minimize.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/num_int.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/plot_3d.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/plot_param_grid.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper/symbolic_BSpline.py +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/SOURCES.txt +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/dependency_links.txt +0 -0
- {ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/requires.txt +0 -0
- {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.
|
|
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.
|
|
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,
|
|
7
|
-
xlabel="x",ylabel="y",
|
|
8
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ibb_helper-0.4.8.dev12 → ibb_helper-0.4.8.dev14}/src/IBB_Helper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|