Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# generally ignore image files (but updates to the examples/images directory should still be noticed)
*.pdf
*.png
!examples/images/*.png

# Distribution / packaging
build/
*.egg-info/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12)
project(DUNEPlotStyle VERSION 01.02 LANGUAGES CXX)
project(DUNEPlotStyle VERSION 01.03 LANGUAGES CXX)

set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
OWNER_READ
Expand Down
6 changes: 3 additions & 3 deletions examples/matplotlib/plotting_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def CovEllipse(xdata, ydata, cov, q=None, nsig=None, facecolor='none', **kwargs)
width, height = 2 * np.sqrt(val[:, None] * r2)
angle = np.degrees(np.arctan2(*vec[::-1, 0]))

xmean = np.mean(xdata)
ymean = np.mean(ydata)
xmean = np.squeeze(np.mean(xdata))
ymean = np.squeeze(np.mean(ydata))

ellipse = Ellipse(xy=(xmean,ymean), width=width, height=height, angle=angle,
ellipse = Ellipse(xy=(xmean,ymean), width=np.squeeze(width), height=np.squeeze(height), angle=np.squeeze(angle),
facecolor=facecolor, **kwargs)

return ellipse
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
matplotlib==3.6.3
numpy==1.24.1
scipy==1.10.0
matplotlib>=3.6.3
numpy>=1.24.1
scipy>=1.10.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dune_plot_style
version = 1.02
version = 1.03
author = DUNE Authorship and Publications Board (APB)
author_email = dune-apb@fnal.gov
description = Plot styling tools
Expand Down
15 changes: 15 additions & 0 deletions src/matplotlib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
try:
# This conceit handles the arrangement that comes out
# when dune_plot_style is set up standalone by using `pip install -e`.
# You may notice that this file is very similar to the one in the python/ subdirectory;
# that's because when installed with a regular `pip install` (without the `-e`),
# this file is not installed anywhere, and is not needed.
# It's only needed because the `install -e` invocation, instead of doing an install,
# simply points back to the package, so the directory structure is not rearranged as it is in installation.
import os, os.path, pathlib
from . import stylelib as module
os.environ["MPLCONFIGDIR"] = os.path.join(str(pathlib.Path(module.__path__[0]).parent.absolute()), "stylelib") + (os.pathsep + os.environ["MPLCONFIGDIR"] if "MPLCONFIGDIR" in os.environ else "")
except:
pass

from .python import *