##### Commands #####
gnuplot2D::
- @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME).$(IN_GNU)" ] ; then \
+ @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME)" -a ! -z "$(IN_GNU)" ] ; then \
if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
OPTION1="set terminal png size $(GNU_X_SIZE), $(GNU_Y_SIZE); set output '$(OUT_GNU_FILE_NAME).$(OUT_GNU)' ;"; \
else \
OPTION2="pause -1 ;" ; \
fi; \
- if [ -z "$(VIEW_GNU_FILE_NAME)" ] ; then \
- VIEW_GNU_FILE_NAME="$(IN_GNU_FILE_NAME).$(IN_GNU)"; \
- else \
- $(RM) $(VIEW_GNU_FILE_NAME); \
- ln -s "$(IN_GNU_FILE_NAME).$(IN_GNU)" $(VIEW_GNU_FILE_NAME); \
- VIEW_GNU_FILE_NAME=$(VIEW_GNU_FILE_NAME); \
- fi; \
- $(G_PLOT_EXE) -e " \
- $$OPTION1 \
- plot '$$VIEW_GNU_FILE_NAME' ; \
- $$OPTION2 \
- "; \
- $(RM) $(VIEW_GNU_FILE_NAME); \
+ $(G_PLOT_EXE) -e "$${OPTION1} plot $$(make gnuplotSet) $${OPTION2}" ; \
echo "success gnuplot2D"; \
else \
echo "failed gnuplot2D"; \
fi;
-
+
gnuplot3D::
- @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME).$(IN_GNU)" ] ; then \
- if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(GNU_Z_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
+ @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME)" -a ! -z "$(IN_GNU)" ] ; then \
+ if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
OPTION1="set terminal png size $(GNU_X_SIZE), $(GNU_Y_SIZE); set output '$(OUT_GNU_FILE_NAME).$(OUT_GNU)' ;"; \
else \
OPTION2="pause -1 ;" ; \
fi; \
- if [ -z "$(VIEW_GNU_FILE_NAME)" ] ; then \
- VIEW_GNU_FILE_NAME="$(IN_GNU_FILE_NAME).$(IN_GNU)"; \
- else \
- $(RM) $(VIEW_GNU_FILE_NAME); \
- ln -s "$(IN_GNU_FILE_NAME).$(IN_GNU)" $(VIEW_GNU_FILE_NAME); \
- VIEW_GNU_FILE_NAME=$(VIEW_GNU_FILE_NAME); \
- fi; \
- $(G_PLOT_EXE) -e " \
- $$OPTION1 \
- splot '$$VIEW_GNU_FILE_NAME' ; \
- $$OPTION2 \
- "; \
- $(RM) $(VIEW_GNU_FILE_NAME); \
+ $(G_PLOT_EXE) -e "$${OPTION1} splot $$(make gnuplotSet) $${OPTION2}" ; \
echo "success gnuplot3D"; \
else \
echo "failed gnuplot3D"; \
fi;
+gnuplotSet::
+ @declare infile=( $(IN_GNU_FILE_NAME) ); \
+ infilenum=$${#infile[@]}; \
+ declare inext=( $(IN_GNU) ); \
+ inextnum=$${#inext[@]}; \
+ declare viewname=( $(VIEW_GNU_FILE_NAME) ); \
+ viewnum=$${#view[@]}; \
+ if [ $$infilenum -le 1 ] ; then \
+ for (( num = 0 ; $$num < $$inextnum ; num++ )) ; \
+ do \
+ fileext="$$infile.$${inext[$$num]}"; \
+ if [ $$num -le $$viewnum ] ; then \
+ view="$${viewname[$$num]}"; \
+ $(RM) $$view; \
+ ln -s "$$fileext" $$view; \
+ else \
+ view="$$fileext"; \
+ fi; \
+ if [ ! -z "$${OPTION3}" ] ; then \
+ OPTION3="$${OPTION3} ,"; \
+ fi; \
+ OPTION3="$${OPTION3} $${view}'"; \
+ done; \
+ elif [ $$inextnum -le 1 ] ; then \
+ for (( num = 0 ; $$num < $$infilenum ; num++ )) ; \
+ do \
+ fileext="$${infile[$$num]}.$$inext"; \
+ if [ $$num -le $$viewnum ] ; then \
+ view="$${viewname[$$num]}"; \
+ $(RM) $$view; \
+ ln -s "$$fileext" $$view; \
+ else \
+ view="$$fileext"; \
+ fi; \
+ if [ ! -z "$${OPTION3}" ] ; then \
+ OPTION3="$${OPTION3} ,"; \
+ fi; \
+ OPTION3="$${OPTION3} '$${view}'"; \
+ done; \
+ else \
+ for (( num = 0 ; $$num < $$infilenum ; num++ )) ; \
+ do \
+ fileext="$${infile[$$num]}.$${inext[$$num]}"; \
+ if [ $$num -le $$viewnum ] ; then \
+ view="$${viewname[$$num]}"; \
+ $(RM) $$view; \
+ ln -s "$$fileext" $$view; \
+ else \
+ view="$$fileext"; \
+ fi; \
+ if [ ! -z "$${OPTION3}" ] ; then \
+ OPTION3="$${OPTION3} ,"; \
+ fi; \
+ OPTION3="$${OPTION3} '$${view}'"; \
+ done; \
+ fi; \
+ echo "$${OPTION3} ;";
+
help_Gnuplot::
@echo
@echo "Gnuplot"
@echo
@echo " (Setting Data):"
@echo " G_PLOT_PATH: gnuplot application directory path in this lib file.(Essential)"
- @echo " IN_GNU_FILE_NAME: input file name."
- @echo " IN_GNU: input file extention."
+ @echo " IN_GNU_FILE_NAME: input file names as Array.(if it has 1 data only, all data is treated as it.)"
+ @echo " IN_GNU: input file extentions as Array.(if it has 1 data only, all data is treated as it.)"
@echo " (Note) Input file is required to be 2D or 3D that is delimited by space or tab."
@echo " ====== If the following is set, output the image. ======"
@echo " OUT_GNU_FILE_NAME: output file name."
@echo " OUT_GNU: output file extention."
@echo " GNU_X_SIZE: output tiff size x"
@echo " GNU_Y_SIZE: output tiff size y"
- @echo " GNU_Z_SIZE: output tiff size z"
@echo " ====== Option ======"
- @echo " VIEW_GNU_FILE_NAME: displayfile name on gnuplot."
+ @echo " VIEW_GNU_FILE_NAME: displayfile names on gnuplot as Array."
@echo
##### Commands(Input to Output) #####