From 495eb2b5c224dfde2e7ba35d0872ddc4aff99270 Mon Sep 17 00:00:00 2001 From: ifilot Date: Tue, 2 May 2023 10:29:38 +0200 Subject: [PATCH 1/2] Fixing bug in CMake --- src/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 186234f..d249dd7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,11 +29,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules ) SET(VERSION_MAJOR "2") SET(VERSION_MINOR "0") SET(VERSION_MICRO "1") -configure_file(config.h.in config.h @ONLY) -if(EXISTS "${CMAKE_BINARY_DIR}/config.h") - MESSAGE("[USER] Creating ${CMAKE_SOURCE_DIR}/config.h from ${CMAKE_BINARY_DIR}/config.h.in") +configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_SOURCE_DIR}/config.h @ONLY) +if(EXISTS "${CMAKE_SOURCE_DIR}/config.h") + MESSAGE("[USER] Creating ${CMAKE_SOURCE_DIR}/config.h from ${CMAKE_SOURCE_DIR}/config.h.in") else() - MESSAGE("[USER] Could not find configuration file in ${CMAKE_BINARY_DIR}!") + MESSAGE("[USER] Could not find configuration file in ${CMAKE_SOURCE_DIR}!") endif() # Enable release build From 93aa9ccaf362da3fc96179ed0da86217e91b3f32 Mon Sep 17 00:00:00 2001 From: ifilot Date: Tue, 2 May 2023 10:36:39 +0200 Subject: [PATCH 2/2] Adding centering feature --- examples/al_fcc111_zavg.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/al_fcc111_zavg.py b/examples/al_fcc111_zavg.py index 30b201a..9b91c92 100644 --- a/examples/al_fcc111_zavg.py +++ b/examples/al_fcc111_zavg.py @@ -9,6 +9,11 @@ data = np.loadtxt('z_extraction.txt') plt.figure(dpi=72) + +# to center the x-axis such that the origin lies at in the middle +# of the graph, uncomment the line below +#data[:,0] = data[:,0] - (np.max(data[:,0]) - np.min(data[:,0])) / 2 + plt.plot(data[:,0], data[:,1], color='black') plt.xlabel(r'z [$\AA$]') plt.ylabel(r'$\rho$ [$\AA^{-3}$]')