kplot 1.1.0__tar.gz → 1.1.1__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.
- {kplot-1.1.0 → kplot-1.1.1}/PKG-INFO +1 -1
- {kplot-1.1.0 → kplot-1.1.1}/pyproject.toml +1 -1
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/image.py +7 -5
- {kplot-1.1.0 → kplot-1.1.1}/README.md +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/__init__.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/axes.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/cmaps.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/hist.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/movie.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/plot.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/styles/example.mpl +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/styles/publication.mpl +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/threeD/__init__.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/threeD/slider_images.py +0 -0
- {kplot-1.1.0 → kplot-1.1.1}/src/kplot/utils.py +0 -0
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
from kplot.axes import access_subplots
|
|
5
5
|
from kplot.utils import alias_kwarg, parse_multiax_params, column_width, two_column_width
|
|
6
6
|
from kplot.cmaps import Norm, Cmap
|
|
7
|
+
|
|
8
|
+
from kbasic.array import tile
|
|
7
9
|
import numpy as np
|
|
8
10
|
import matplotlib.pyplot as plt
|
|
9
11
|
from mpl_toolkits.axes_grid1 import make_axes_locatable
|
|
@@ -148,7 +150,7 @@ def show(
|
|
|
148
150
|
figsize: tuple[float, float] = (10, 10),
|
|
149
151
|
show: bool = False,
|
|
150
152
|
#plot parameters
|
|
151
|
-
cmap =
|
|
153
|
+
cmap = plt.cm.plasma,
|
|
152
154
|
colorbar: bool = True,
|
|
153
155
|
colorbar_style: dict = {'location':'right', "size":"7%", "pad":0.05},
|
|
154
156
|
cticks: list|None = None,
|
|
@@ -268,7 +270,7 @@ def contour(
|
|
|
268
270
|
assert (ndims:=len(Z.shape))==2, f"show was given an image with {ndims} dimensions, please provide a 2d array"
|
|
269
271
|
# check axes
|
|
270
272
|
if x is None: x, y = np.mgrid[:Z.shape[0], :Z.shape[1]]
|
|
271
|
-
else: assert (len(x), len(y)) == Z.shape, f"Given x of shape {len(x)} and y of shape {len(y)} but image is of shape {
|
|
273
|
+
else: assert (len(x), len(y)) == Z.shape, f"Given x of shape {len(x)} and y of shape {len(y)} but image is of shape {Z.shape}"
|
|
272
274
|
# prep figure
|
|
273
275
|
if ax is None: (fig, ax) = plt.subplots(figsize=figsize)
|
|
274
276
|
fig = ax.get_figure()
|
|
@@ -313,7 +315,7 @@ def contourf(
|
|
|
313
315
|
show: bool = False,
|
|
314
316
|
#plot parameters
|
|
315
317
|
levels = 10,
|
|
316
|
-
cmap =
|
|
318
|
+
cmap = plt.cm.plasma,
|
|
317
319
|
colorbar: bool = True,
|
|
318
320
|
colorbar_style: dict = {'location':'right', "size":"7%", "pad":0.05},
|
|
319
321
|
cticks: list|None = None,
|
|
@@ -331,8 +333,8 @@ def contourf(
|
|
|
331
333
|
# prep data
|
|
332
334
|
assert (ndims:=len(Z.shape))==2, f"show was given an image with {ndims} dimensions, please provide a 2d array"
|
|
333
335
|
# check axes
|
|
334
|
-
if x is None: x, y = np.mgrid[:
|
|
335
|
-
else: assert (len(x), len(y)) ==
|
|
336
|
+
if x is None: x, y = np.mgrid[:Z.shape[0], :Z.shape[1]]
|
|
337
|
+
else: assert (len(x), len(y)) == Z.shape, f"Given x of shape {len(x)} and y of shape {len(y)} but image is of shape {Z.shape}"
|
|
336
338
|
# prep figure
|
|
337
339
|
if ax is None: (fig, ax) = plt.subplots(figsize=figsize)
|
|
338
340
|
fig = ax.get_figure()
|
|
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
|