plotting arrow in python
Dear friends, I am very new in python. Actually, I think I will not do much python then using it to plotting data. I have not done any "real" thing in python, so plz be easy. Now , the problem I have a data set: 0.0 0.0 0.1 0.0 0.1 0.1 0.1 0.0 0.5 like that! the first two column are coordinate and 3rd one is magnitude of moment (say: x y,m)!! so what i want to do is draw an arrow of magnitude(m) in the position (x,y). I know how python read array, and how to draw an array(via matplotlib)...but totally confused with this one. can you people plz help? -- http://mail.python.org/mailman/listinfo/python-list
Re: plotting arrow in python
On Nov 22, 6:58 am, Gregory Ewing wrote: > > rudra wrote: > > >> 0.0 0.0 0.1 > >> 0.0 0.1 0.1 > >> 0.1 0.0 0.5 > > >> like that! the first two column are coordinate and 3rd one is > >> magnitude of moment (say: x y,m)!! so what i want to do is draw an > >> arrow of magnitude(m) in the position (x,y). > > There seems to be some information missing there. > How do you know what direction to draw the arrow in? > > -- > Greg Greg, you are right direction is also needed. But as a beginner, I am trying to make it simple and all arrows are collinear along x axis!! then i have to try non collinear as well. thank you -- http://mail.python.org/mailman/listinfo/python-list
vpython installation problem
NGOFT2... yes checking for FREETYPE2... yes checking for GTK... yes checking for GTHREAD... yes checking where to install documentation... ${prefix}/lib/python2.6/ site-packages/visual/docs checking whether to install html documentation... yes checking where to install example programs... ${prefix}/lib/python2.6/ site-packages/visual/examples checking whether to install example programs... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating site-packages/visual/Makefile config.status: creating docs/Makefile config.status: creating examples/Makefile config.status: creating bin/vpython config.status: creating include/config.h config.status: include/config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands but make fails: $ make Making all in site-packages/visual make[1]: Entering directory `/home/rudra/visual-5.13_release/site- packages/visual' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/rudra/visual-5.13_release/site- packages/visual' Making all in src make[1]: Entering directory `/home/rudra/visual-5.13_release/src' Compiling ./python/arrayprim.cpp ... make[1]: *** [arrayprim.lo] Error 1 make[1]: Leaving directory `/home/rudra/visual-5.13_release/src' make: *** [all-recursive] Error 1 what I can do? -- http://mail.python.org/mailman/listinfo/python-list
load and plot from multiple file
Dear friends, I have several 2 column file which i need to plot in one figure. I generally do it using gnuplot, but when there is several files, its hard to do manually. can you tell me how i can load a file in python and plot several file in one figure(as it is done via replot in gnuplot)? I am novice in python, but tried the matplotlib...with no luck. will u plz help? -- http://mail.python.org/mailman/listinfo/python-list
Re: load and plot from multiple file
On Jul 10, 1:13 pm, Tim Harig wrote: > It would really help to see a representative sample of the data that you > are working with and what you want the plot to look like. The data looks something like that: 0.70711 -2.57266 1.0 0.16694 1.22474 -0.15287 1.41421 0.28025 1.58114 -0.03806 1.73205 0.05049 1.87083 -0.01686 2.0 -0.02918 2.12132 0.00246 2.12132 0.13460 2.23607 -0.01552 2.34521 -0.00033 2.44949 0.00550 2.54951 -0.00827 2.54951 -0.01189 2.73861 0.00397 2.82843 0.04685 2.91548 -0.00115 2.91548 -0.00951 3.0 0.00069 3.0 0.00214 and there are several such file. I need two types of plotting: 1) multiple plot in same figure 2) grid of plots with different data in different grid -- http://mail.python.org/mailman/listinfo/python-list
awk like usage in python
Friends, I am in process learning python. I basically use shell scripts for text formatting and trying my hand on python. where I am fighting is awk's functionality in python. Say, one of my real tiny code looks like: #!/bin/bash TMP=store for i in $1/MnBi_EOS_* do # echo $i grep -A 15 "T(est)" $i/out-Dy-eos2 >$TMP var_T=`awk '/T\(est\)/{printf $2}' $TMP` var_s1=`awk '/s1,torque/{print $6;exit}' $TMP` var_t=`awk '/s1,torque/{print $7;exit}' $TMP` echo $var_T $var_s1 $var_t >>tfl # echo "" # echo "" done sort -n tfl >$2 rm -i $TMP tfl where the store looks like: T(est)= 266.58K TOTDOS= 0.48669E+02n_Ef= 0.62856E+02 Ebnd-0.11707E+02 spec,subl=11N= 0.72132E+01s1c=-0.50284E+00 spec,subl=11lined-up= 0.9E+00 species,subl,cmp=111s1,torque= 0.59382E-02 0.36773E-04 species,sublat,cmp=111sp-mom= 0.14449E+01 species,sublat,cmp=111orbmom= 0.41075E-01 species,subl,cmp=112s1,torque=-0.33939E-12 0.20885E-12 species,sublat,cmp=112sp-mom= 0.54080E+00 species,sublat,cmp=112orbmom= 0.14921E-01 species,subl,cmp=113s1,torque= 0.60002E-02 0.15728E-02 species,sublat,cmp=113sp-mom= 0.14448E+01 species,sublat,cmp=113orbmom= 0.43989E-01 spec,subl=12N= 0.72132E+01s1c=-0.50284E+00 spec,subl=12lined-up= 0.9E+00 species,subl,cmp=121s1,torque= 0.59378E-02 0.36850E-04 How can I import the awk functionality in python? -- http://mail.python.org/mailman/listinfo/python-list
compile a python3 project with autotools
Hi, I am trying to compile a python project using autotools. The project runs absolutely fine from command line, and it uses Gtk3 library. the src file is: ├── src │ ├── Makefile.am │ ├── Makefile.in │ ├── Mkbib │ │ ├── cell.py │ │ ├── dialogue.py │ │ ├── filemanager.py │ │ ├── getdata.py │ │ ├── __init__.py │ │ ├── main.py │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── menu.py │ │ ├── mkbib.in │ │ ├── pybib.py │ │ └── view.py │ └── mkbib.in with the mkbib.in is: #!/usr/bin/env python3 import sys sys.path.insert(1, '@pythondir@') from mkbib.main import mkbib if __name__ == "__main__": app = mkbib() r = app.run() sys.exit(r) src/Mkbib/main.py is the main program. This is structured as: class Window(Gtk.ApplicationWindow): def __init__(self, application, giofile=None): Gtk.ApplicationWindow.__init__(self, application=application, default_width=1000, default_height=200, border_width=5) class mkbib(Gtk.Application): def __init__(self): Gtk.Application.__init__(self) def new_window(self, filename=None): window = Window(self) window.show_all() def run(self): self.new_window() Gtk.main() Now, the problem is it is compiling fine (make; make install goes without any error) make --silent Making all in data Making all in icons Making all in hicolor Making all in 48x48 Making all in apps Making all in scalable Making all in apps Making all in ui Making all in src Making all in Mkbib but while running the application, I am getting error: (mkbib:14843): Gtk-CRITICAL **: New application windows must be added after the GApplication::startup signal has been emitted. May I be kindly helped? -- https://mail.python.org/mailman/listinfo/python-list
Re: compile a python3 project with autotools
Plz ignore src/Mkbib/mkbib.in file, as appeared in the tree -- https://mail.python.org/mailman/listinfo/python-list
Re: compile a python3 project with autotools
On Monday, August 15, 2016 at 12:39:33 AM UTC+2, Lawrence D’Oliveiro wrote: > On Monday, August 15, 2016 at 9:24:04 AM UTC+12, Rudra Banerjee wrote: > > but while running the application, I am getting error: > > (mkbib:14843): Gtk-CRITICAL **: New application windows must be added after > > the GApplication::startup signal has been emitted. > > Does the application actually fail? > > Because I see a lot of this sort of thing, which doesn’t seem to actually > affect the running of the application. > > So I ignore it. :) It fails to close, if I run it from command line. Also, even if I close it by close button, the command line does not return. -- https://mail.python.org/mailman/listinfo/python-list
Check required modules using autotools
Hi, I am compiling a python3 project using gnu-autotools. This is my configure.ac file (Please ignore the recursive Makefile, I have not managed to make the non-recursive one). AC_INIT([mkbib], [0.1],[],[mkbib]) AM_INIT_AUTOMAKE([1.9.6 dist-bzip2 subdir-objects]) AM_PATH_PYTHON([3.0]) dnl AX_PYTHON_MODULE([bibtexparser],[required]) AC_CONFIG_FILES([Makefile data/Makefile data/mkbib.desktop data/icons/Makefile data/icons/hicolor/Makefile data/icons/hicolor/48x48/Makefile data/icons/hicolor/48x48/apps/Makefile data/icons/hicolor/scalable/Makefile data/icons/hicolor/scalable/apps/Makefile data/ui/Makefile ]) AC_OUTPUT I am trying to check presence of bibtexparser module (https://pypi.python.org/pypi/bibtexparser/0.5.2); which is giving error: ./configure: line 2589: syntax error near unexpected token `bibtexparser,' ./configure: line 2589: `AX_PYTHON_MODULE(bibtexparser, fatal)' I have also tried: PKG_CHECK_MODULES([GTK], [gtk+-2.0]) PKG_CHECK_MODULES([GLIB], [glib-2.0]) PKG_CHECK_MODULES([bibtex], [bibtexparser]) But This is giving error as well. ./configure: line 2589: syntax error near unexpected token `GTK,' ./configure: line 2589: `PKG_CHECK_MODULES(GTK, gtk+-2.0)' -- https://mail.python.org/mailman/listinfo/python-list
suitability of python
Dear friends, I am a newbie in python and basically i use python for postprocessing like plotting, data manipulation etc. Based on ease of programming on python I am wondering if I can consider it for the main development as well. My jobs (written on fortran) runs for weeks and quite CPU intensive. How python works on these type of heavy computation? Any comment or reference is welcome. -- http://mail.python.org/mailman/listinfo/python-list