|
From: <ai...@us...> - 2009-11-15 02:42:49
|
Revision: 10590
http://plplot.svn.sourceforge.net/plplot/?rev=10590&view=rev
Author: airwin
Date: 2009-11-15 01:30:26 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
Add example to test axis precision commands.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_axis_precision.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2009-11-14 21:17:15 UTC (rev 10589)
+++ trunk/examples/python/CMakeLists.txt 2009-11-15 01:30:26 UTC (rev 10590)
@@ -77,6 +77,7 @@
xw31.py
plplot_logo.py
test_circle.py
+ test_axis_precision.py
testh.py
test_superscript_subscript.py
)
Added: trunk/examples/python/test_axis_precision.py
===================================================================
--- trunk/examples/python/test_axis_precision.py (rev 0)
+++ trunk/examples/python/test_axis_precision.py 2009-11-15 01:30:26 UTC (rev 10590)
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+from numpy import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+plsyax(10000, 0)
+pladv(0)
+plvpor(0.1, 0.9, 0.1, 0.9)
+plwind(0.00, 1.00, 0.00, 0.08)
+plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0);
+plend()
Property changes on: trunk/examples/python/test_axis_precision.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-11-16 22:34:05
|
Revision: 10605
http://plplot.svn.sourceforge.net/plplot/?rev=10605&view=rev
Author: airwin
Date: 2009-11-16 22:33:58 +0000 (Mon, 16 Nov 2009)
Log Message:
-----------
Add test case to see whether symbols are properly clipped.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_symbol_clip.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2009-11-16 19:28:11 UTC (rev 10604)
+++ trunk/examples/python/CMakeLists.txt 2009-11-16 22:33:58 UTC (rev 10605)
@@ -78,6 +78,7 @@
plplot_logo.py
test_circle.py
test_axis_precision.py
+ test_symbol_clip.py
testh.py
test_superscript_subscript.py
)
Added: trunk/examples/python/test_symbol_clip.py
===================================================================
--- trunk/examples/python/test_symbol_clip.py (rev 0)
+++ trunk/examples/python/test_symbol_clip.py 2009-11-16 22:33:58 UTC (rev 10605)
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+from numpy import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+plssym(0., 10.)
+plenv(0,1,0,1,0,0)
+plpoin([1.0],[0.5],0)
+plend()
Property changes on: trunk/examples/python/test_symbol_clip.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-11-28 00:39:50
|
Revision: 10637
http://plplot.svn.sourceforge.net/plplot/?rev=10637&view=rev
Author: airwin
Date: 2009-11-28 00:39:41 +0000 (Sat, 28 Nov 2009)
Log Message:
-----------
Add simple test for whether you get the same result for UTF-8 and
PLplot #[0x....] encoding for unicode. The new example also tests whether
a given device driver responds correctly to the #<FCI-COMMAND/> escape
sequence to change font characteristics in the middle of a string.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_plplot_encodings.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2009-11-27 18:55:12 UTC (rev 10636)
+++ trunk/examples/python/CMakeLists.txt 2009-11-28 00:39:41 UTC (rev 10637)
@@ -1,7 +1,7 @@
# examples/python/CMakeLists.txt
### Process this file with cmake to produce Makefile
###
-# Copyright (C) 2006 Alan W. Irwin
+# Copyright (C) 2006, 2007, 2008, 2009 Alan W. Irwin
#
# This file is part of PLplot.
#
@@ -81,6 +81,7 @@
test_symbol_clip.py
testh.py
test_superscript_subscript.py
+ test_plplot_encodings.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_plplot_encodings.py
===================================================================
--- trunk/examples/python/test_plplot_encodings.py (rev 0)
+++ trunk/examples/python/test_plplot_encodings.py 2009-11-28 00:39:41 UTC (rev 10637)
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# -*- coding: utf-8; -*-
+# Test whether utf8 and PLplot #[0x...] unicode encoding give same result.
+# Also test whether #<FCI-COMMAND-STRING/> form works to change font
+# characteristics on the fly.
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+from numpy import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+plcol0(2)
+pladv(0)
+plvpor(0.1, 0.9, 0.1, 0.9)
+plwind(0., 1., 0., 1.)
+# Just to show edges of viewport
+plbox("bc", 0., 0, "bc", 0., 0)
+plcol0(1)
+plschr(0., 2.)
+plptex(0.5, 0.5, 1., 0., 0.5, "#<sans-serif/>#[0x222e] is a path integral sign.")
+# semitransparent green.
+plscol0a(2, 0, 255, 0, 0.5)
+plcol0(2)
+plptex(0.5, 0.5, 1., 0., 0.5, "#<sans-serif/>∮ is a path integral sign.")
+plend()
Property changes on: trunk/examples/python/test_plplot_encodings.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-11-28 01:16:02
|
Revision: 10638
http://plplot.svn.sourceforge.net/plplot/?rev=10638&view=rev
Author: airwin
Date: 2009-11-28 01:15:51 +0000 (Sat, 28 Nov 2009)
Log Message:
-----------
Implement simple test of plfill for the case where the polygon is just
outside the window to demonstrate a current bug (no fill) for this situation.
If you reverse the sign of eps so the polygon is just inside the window,
then the fill occurs properly. If one side of the polygon is just
inside the window (replace xmin = xmin - eps with xmin = xmin +eps), then
the fill occurs in that case as well.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_fill.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2009-11-28 00:39:41 UTC (rev 10637)
+++ trunk/examples/python/CMakeLists.txt 2009-11-28 01:15:51 UTC (rev 10638)
@@ -82,6 +82,7 @@
testh.py
test_superscript_subscript.py
test_plplot_encodings.py
+ test_fill.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_fill.py
===================================================================
--- trunk/examples/python/test_fill.py (rev 0)
+++ trunk/examples/python/test_fill.py 2009-11-28 01:15:51 UTC (rev 10638)
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+# Simple test of plfill for the case where the polygon is just outside the
+# window.
+
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+from numpy import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+plcol0(2)
+pladv(0)
+plvpor(0.1, 0.9, 0.1, 0.9)
+xmin,xmax,ymin,ymax = (0., 1., 0., 1.)
+plwind(xmin, xmax, ymin, ymax)
+# Just to show edges of viewport
+plbox("bc", 0., 0, "bc", 0., 0)
+plcol0(1)
+eps = 0.001
+xmin,xmax,ymin,ymax = (xmin - eps, xmax + eps, ymin - eps, ymax + eps)
+x = (xmin, xmax, xmax, xmin)
+y = (ymin, ymin, ymax, ymax)
+plfill(x,y)
+plend()
Property changes on: trunk/examples/python/test_fill.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-11-29 07:51:35
|
Revision: 10645
http://plplot.svn.sourceforge.net/plplot/?rev=10645&view=rev
Author: airwin
Date: 2009-11-29 07:51:23 +0000 (Sun, 29 Nov 2009)
Log Message:
-----------
Add simple script to test plgradient functionality.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_gradient.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2009-11-29 07:50:29 UTC (rev 10644)
+++ trunk/examples/python/CMakeLists.txt 2009-11-29 07:51:23 UTC (rev 10645)
@@ -83,6 +83,7 @@
test_superscript_subscript.py
test_plplot_encodings.py
test_fill.py
+ test_gradient.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_gradient.py
===================================================================
--- trunk/examples/python/test_gradient.py (rev 0)
+++ trunk/examples/python/test_gradient.py 2009-11-29 07:51:23 UTC (rev 10645)
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# Simple test of plgradient for a complicated polygon.
+
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+from numpy import *
+from math import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+xmin,xmax,ymin,ymax = (0., 1., 0., 1.)
+x = (0., 0.2, 1., 0.3)
+y = (0., 1., 0.2, 0.6)
+#x = (0., 0., 1., 1.)
+#y = (0., 1., 1., 0.)
+# Initialize plplot
+plinit()
+for i in range(1):
+ plcol0(2)
+ pladv(0)
+ plvpor(0.1, 0.9, 0.1, 0.9)
+ plwind(xmin, xmax, ymin, ymax)
+# Just to show edges of viewport
+ plbox("bc", 0., 0, "bc", 0., 0)
+ plcol0(1)
+ plgradient(x,y, 45. + i)
+plend()
Property changes on: trunk/examples/python/test_gradient.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2009-12-04 16:22:22
|
Revision: 10679
http://plplot.svn.sourceforge.net/plplot/?rev=10679&view=rev
Author: airwin
Date: 2009-12-04 16:22:14 +0000 (Fri, 04 Dec 2009)
Log Message:
-----------
Create plplot_logo target to generate both the SVG and JPEG form of the
logo.
Modify logo generation instructions to use that plplot_logo target.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
trunk/examples/python/README.logo
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2009-12-04 08:10:31 UTC (rev 10678)
+++ trunk/examples/python/CMakeLists.txt 2009-12-04 16:22:14 UTC (rev 10679)
@@ -137,7 +137,6 @@
README.pythondemos
README.rendering_tests
README.logo
- svg_760x120_gradient.patch
)
if(ENABLE_pygcw)
@@ -252,3 +251,36 @@
)
endforeach(file ${python_SCRIPTS} ${python_DATA} plplot_python_start.py plplot_py_demos.py)
endif(CORE_BUILD)
+
+# Custom target to build logo (Unix only with ImageMagick installed).
+if(BUILD_TEST)
+ if(CORE_BUILD)
+ set(working_directory ${CMAKE_CURRENT_BINARY_DIR})
+ else(CORE_BUILD)
+ set(working_directory ${CMAKE_CURRENT_SOURCE_DIR})
+ endif(CORE_BUILD)
+ set(command_file ${working_directory}/plplot_logo.py)
+ add_custom_command(
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.svg
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.jpg
+ COMMAND ${command_file} -dev svg -geometry 760x120
+ -o ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.svg
+ COMMAND convert
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.svg
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.jpg
+ DEPENDS ${command_file}
+ WORKING_DIRECTORY ${working_directory}
+ )
+ add_custom_target(plplot_logo
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.svg
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_logo.jpg
+ )
+ if(CORE_BUILD)
+ add_dependencies(plplot_logo python_examples _plplotcmodule)
+ else(CORE_BUILD)
+ add_dependencies(plplot_logo _plplotcmodule)
+ endif(CORE_BUILD)
+
+endif(BUILD_TEST)
\ No newline at end of file
Modified: trunk/examples/python/README.logo
===================================================================
--- trunk/examples/python/README.logo 2009-12-04 08:10:31 UTC (rev 10678)
+++ trunk/examples/python/README.logo 2009-12-04 16:22:14 UTC (rev 10679)
@@ -1,15 +1,22 @@
To produce an SVG form of the logo with -dev svg (which is the device which
plplot_logo.py has been explicitly tuned for) execute
-python/plplot_logo.py -dev svg -o plplot_logo.svg -geometry 760x120
+make plplot_logo
-in either the build tree examples directory (after "make python_examples")
-or the install-tree examples directory (after "make install").
+in either the top-level of the build tree (configured with cmake
+option -DBUILD_TEST=ON) or (after "make install" is run) in the build
+tree of the installed examples configured by the new CMake-based build
+system for those examples.
-The results look great on konqueror, but they are slow to render.
-The results also look good for display (for the default compensation
-for text shifts) and take very little time to render.
+The above command generates both plplot_logo.svg and plplot_logo.jpg
+(see below) in examples/python (if working in the top-level of the
+core build tree) or python (if working in the top-level of the
+installed examples build tree).
+The plplot_logo.svg results look great on konqueror, but they are slow
+to render. The results also look good for display (for the default
+compensation for text shifts) and take very little time to render.
+
Partially because of the file-bloating issue discussed on list (lots of
graphical objects outside device boundaries that are still included in the
file), the size of the file is 1.8M. (Of course, another reason for this
@@ -20,7 +27,7 @@
gzip -c <plplot_logo.svg >| plplot_logo.svgz
-then the result is only 97 K (which is mostly reasonable) and a factor of
+then the result is only 97 K (which is almost reasonable) and a factor of
almost 20 (!) in size over uncompressed. Other results follow:
(1) The compressed result can still be quickly rendered with "display".
@@ -41,10 +48,12 @@
However, the uncompressed result (after a long upload) validates properly
at w3c.
-Until the *.svgz compressed form becomes well-recognized (not least by w3c),
-it is probably best to convert to jpeg to improve rendering speed/reduce
-bandwidth compared to the uncompressed svg file. This convert step also
-appears to get rid of everything outside the device boundaries.
+Until the *.svgz compressed form becomes well-recognized (not least of
+all by w3c), it is probably best to convert to jpeg to improve
+rendering speed/reduce bandwidth compared to the uncompressed svg
+file. This convert step (also done with the above "make plplot_logo"
+command) appears to get rid of everything outside the device
+boundaries.
convert plplot_logo.svg plplot_logo.jpg
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-04-20 20:53:01
|
Revision: 10929
http://plplot.svn.sourceforge.net/plplot/?rev=10929&view=rev
Author: airwin
Date: 2010-04-20 20:52:55 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Implement an example to display all Type 1 glyphs that are potentially
accessible to the ps(c) device in a similar manner to the historical
gfontview application. The ps.c file must be edited to #define
PL_TEST_TYPE1 in order to make this example work properly.
The point of this example is to duplicate the functionality of the gfontview
application which is no longer being actively developed. Because of this
app's dependence on freetype1 (as opposed to modern freetype) modern distros
have been forced to abandon this useful application which is why I have had
to emulate it with test_type1.py.
If this example (with ps built with PL_TEST_TYPE1 #defined) shows a type1
glyph that would be useful to PLplot, then it is straightforward to edit the
unicode to type1 index translation table at include/plunicode-type1.h to
make that glyph accessible to PLplot by unicode index for ordinary builds of
ps that do not #define PL_TEST_TYPE1.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_type1.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-04-20 20:37:51 UTC (rev 10928)
+++ trunk/examples/python/CMakeLists.txt 2010-04-20 20:52:55 UTC (rev 10929)
@@ -84,6 +84,7 @@
test_plplot_encodings.py
test_fill.py
test_gradient.py
+ test_type1.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_type1.py
===================================================================
--- trunk/examples/python/test_type1.py (rev 0)
+++ trunk/examples/python/test_type1.py 2010-04-20 20:52:55 UTC (rev 10929)
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+# $Id$
+# Copyright 2010 Alan W. Irwin
+# This file is part of PLplot.
+
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+
+# You should have received a copy of the GNU Library General Public License
+# along with the file PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Plots all the Type1 fonts that are available with -dev psc.
+# N.B. ps.c must be compiled with -DPL_TEST_TYPE1 (which interprets
+# unicode in the range from 0 to 255 directly as Type1 font indices.)
+
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot_py_demos import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+plsetopt("dev", "ps")
+plsetopt("drvopt", "hrshsym=0")
+
+# Initialize plplot
+plinit()
+
+# main
+#
+# Displays all available Type1 glyphs.
+
+family = (
+"sans-serif",
+"serif",
+"monospace",
+"script",
+"symbol",
+)
+style = (
+"upright",
+"italic",
+"oblique",
+)
+weight = (
+"medium",
+"bold",
+)
+def main():
+
+
+ FCI_COMBINATIONS = 30
+ plsfont(0, 0, 0)
+ for index_fci in range(0,FCI_COMBINATIONS):
+ family_index = index_fci % 5
+ style_index = (index_fci/5) % 3
+ weight_index = ((index_fci/5)/3) % 2
+ title = "Type 1 glyphs for family = " + family[family_index] + ", style = " + style[style_index] + ", weight = " + weight[weight_index]
+ pladv(0)
+
+# Set up viewport and window
+
+ plcol0(2)
+ plvpor(0.1, 1.0, 0.1, 0.9)
+ plwind(0.0, 1.0, 0.0, 1.0)
+
+# Draw the grid using plbox
+
+ plbox("bcg", 1./16., 0, "bcg", 1./16., 0)
+
+# Write the digits below the frame
+
+ plcol0(15)
+ for i in range(16):
+ plmtex("b", 1.5, ((i+0.5)/16.), 0.5, str(i))
+
+ k = 0
+ plmtex("t", 1.5, 0.5, 0.5, title)
+ for i in range(16):
+
+ # Write the digits to the left of the frame
+
+ plmtex("lv", 1.0, (1.0 - (i+0.5)/16.), 1.0, str(16 * i))
+
+ plsfont(family_index, style_index, weight_index)
+ for j in range(16):
+ x = (j+0.5)/16.
+ y = 1. - (i+0.5)/16
+
+ # Display the Type 1 glyph corresponding to k
+ plptex(x, y, 1., 0., 0.5, unichr(k).encode('utf-8'))
+ k = k + 1
+ plsfont(0, 0, 0)
+
+
+ # Restore defaults
+ #plcol0(1)
+
+main()
+plend()
Property changes on: trunk/examples/python/test_type1.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-05-03 02:03:19
|
Revision: 10962
http://plplot.svn.sourceforge.net/plplot/?rev=10962&view=rev
Author: airwin
Date: 2010-05-03 02:03:13 +0000 (Mon, 03 May 2010)
Log Message:
-----------
Explicitly specify pltr as None for plshade and plshades which translates
to NULL at the C level and which is interpreted there as defining the x
and y arrays from xmin, xmax, nx and ymin, ymax, and ny. This is very
different from using pltr0 (the default user-friendly result if nothing
is specified for pltr).
This solves the Python (but of course not yet Tcl) issue of dropping the
pltr_data tests for NULL at the C level. We were relying on that before to
obtain the xmin, xmax,... result but when that is dropped we were
incorrectly getting the python user-friendly pltr0 default.
Modified Paths:
--------------
trunk/examples/python/xw15.py
trunk/examples/python/xw21.py
Modified: trunk/examples/python/xw15.py
===================================================================
--- trunk/examples/python/xw15.py 2010-05-03 01:52:09 UTC (rev 10961)
+++ trunk/examples/python/xw15.py 2010-05-03 02:03:13 UTC (rev 10962)
@@ -72,7 +72,7 @@
# in X and Y coordinates
plshade( z, -1., 1., -1., 1.,
shade_min, shade_max, sh_cmap, sh_color, sh_width,
- min_color, min_width, max_color, max_width, 1)
+ min_color, min_width, max_color, max_width, 1, None, None)
plcol0(1)
plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0)
@@ -114,7 +114,7 @@
# in X and Y coordinates
plshade( z, -1., 1., -1., 1.,
shade_min, shade_max, sh_cmap, sh_color, sh_width,
- min_color, min_width, max_color, max_width, 1)
+ min_color, min_width, max_color, max_width, 1, None, None)
plcol0(1)
plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0)
Modified: trunk/examples/python/xw21.py
===================================================================
--- trunk/examples/python/xw21.py 2010-05-03 01:52:09 UTC (rev 10961)
+++ trunk/examples/python/xw21.py 2010-05-03 02:03:13 UTC (rev 10962)
@@ -154,7 +154,7 @@
plenv0(xm,xM,ym,yM,2,0)
plcol0(15)
pllab('X','Y',title[alg-1])
- plshades(zg, xm, xM, ym, yM, clev, 1, 1)
+ plshades(zg, xm, xM, ym, yM, clev, 1, 1, None, None)
plcol0(2)
else:
clev = lzm + (lzM-lzm)*arange(nl)/(nl-1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-05-07 04:56:10
|
Revision: 10976
http://plplot.svn.sourceforge.net/plplot/?rev=10976&view=rev
Author: airwin
Date: 2010-05-07 04:56:04 +0000 (Fri, 07 May 2010)
Log Message:
-----------
Initial commit of special test to show Chapter 1 verse 3 of Genesis in
Hebrew to test alignment of diacritical marks.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_hebrew_diacritic.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-05-06 22:30:56 UTC (rev 10975)
+++ trunk/examples/python/CMakeLists.txt 2010-05-07 04:56:04 UTC (rev 10976)
@@ -85,6 +85,7 @@
test_fill.py
test_gradient.py
test_type1.py
+ test_hebrew_diacritic.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_hebrew_diacritic.py
===================================================================
--- trunk/examples/python/test_hebrew_diacritic.py (rev 0)
+++ trunk/examples/python/test_hebrew_diacritic.py 2010-05-07 04:56:04 UTC (rev 10976)
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+# -*- coding: utf-8; -*-
+# $Id$
+
+# Copyright (C) 2010 Alan W. Irwin
+
+# Displays Genesis Chapter 1 verse 3 "And God said: 'Let there be
+# light.' And there was light" in Hebrew as a test of diacritical
+# mark positioning.
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+
+from plplot_py_demos import *
+
+def main():
+ pladv(0)
+ plcol0(2)
+ plvpor(0.02, 0.98, 0.02, 0.90)
+ plwind(0.0, 1.0, 0.0, 1.0)
+ plsfci(0)
+ plschr(0., 2.5)
+ # The text is Genesis, Chapter 1 verse 3 in Hebrew.
+ plptex (0.5, 0.5, 1., 0., 0.5, "וַיֹּאמֶר אֱלֹהִים יְהִי אוֹר וַיְהִי אוֹר וַיַּרְא")
+ plschr(0., 1.0)
+ # Restore defaults
+ plcol0(1)
+main()
+plend()
+
Property changes on: trunk/examples/python/test_hebrew_diacritic.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2010-05-17 09:54:39
|
Revision: 10998
http://plplot.svn.sourceforge.net/plplot/?rev=10998&view=rev
Author: andrewross
Date: 2010-05-17 09:54:32 +0000 (Mon, 17 May 2010)
Log Message:
-----------
Update python versions of examples 6 and 7 consistent with changes to C version.
Modified Paths:
--------------
trunk/examples/python/xw06.py
trunk/examples/python/xw07.py
Modified: trunk/examples/python/xw06.py
===================================================================
--- trunk/examples/python/xw06.py 2010-05-14 21:19:09 UTC (rev 10997)
+++ trunk/examples/python/xw06.py 2010-05-17 09:54:32 UTC (rev 10998)
@@ -29,44 +29,59 @@
def main():
- pladv(0)
+ for kind_font in range(2):
- # Set up viewport and window
+ plfontld( kind_font )
- plcol0(2)
- plvpor(0.1, 1.0, 0.1, 0.9)
- plwind(0.0, 1.0, 0.0, 1.3)
+ if kind_font == 0 :
+ maxfont = 1
+ else :
+ maxfont = 4
- # Draw the grid using plbox
+ for font in range(maxfont):
+ plfont( font + 1 )
- plbox("bcg", 0.1, 0, "bcg", 0.1, 0)
+ pladv(0)
- # Write the digits below the frame
+ # Set up viewport and window
- plcol0(15)
- for i in range(10):
- plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
+ plcol0(2)
+ plvpor(0.1, 1.0, 0.1, 0.9)
+ plwind(0.0, 1.0, 0.0, 1.3)
- k = 0
- for i in range(13):
+ # Draw the grid using plbox
- # Write the digits to the left of the frame
+ plbox("bcg", 0.1, 0, "bcg", 0.1, 0)
- plmtex("lv", 1.0, (1.0 - (2 * i + 1) / 26.0), 1.0, `10 * i`)
+ # Write the digits below the frame
- for j in range(10):
- x = 0.1 * j + 0.05
- y = 1.25 - 0.1 * i
+ plcol0(15)
+ for i in range(10):
+ plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
- # Display the symbol (plpoin expects that x
- # and y are arrays so pass lists)
+ k = 0
+ for i in range(13):
- if k < 128:
- plpoin([x], [y], k)
- k = k + 1
+ # Write the digits to the left of the frame
- plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols")
+ plmtex("lv", 1.0, (1.0 - (2 * i + 1) / 26.0), 1.0, `10 * i`)
+
+ for j in range(10):
+ x = 0.1 * j + 0.05
+ y = 1.25 - 0.1 * i
+
+ # Display the symbol (plpoin expects that x
+ # and y are arrays so pass lists)
+ if k < 128:
+ plpoin([x], [y], k)
+ k = k + 1
+
+ if kind_font == 0 :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)")
+ else :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)")
+
# Restore defaults
#plcol0(1)
Modified: trunk/examples/python/xw07.py
===================================================================
--- trunk/examples/python/xw07.py 2010-05-14 21:19:09 UTC (rev 10997)
+++ trunk/examples/python/xw07.py 2010-05-17 09:54:32 UTC (rev 10998)
@@ -29,10 +29,15 @@
def main():
- base = [0, 200, 500, 600, 700, 800, 900, 2000, 2100,
- 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900]
+ base = [0, 100, 0, 100, 200, 500, 600, 700, 800, 900, 2000,
+ 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900]
- for l in range(17):
+ plfontld( 0 )
+
+ for l in range(20):
+ if l == 2:
+ plfontld( 1 )
+
pladv(0)
# Set up viewport and window
@@ -67,9 +72,11 @@
plsym(x, y, base[l] + k)
k = k + 1
+ if l < 2 :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)")
+ else :
+ plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)")
- plmtex("t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols")
-
# Restore defaults
#plcol0(1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-07-23 20:33:13
|
Revision: 11104
http://plplot.svn.sourceforge.net/plplot/?rev=11104&view=rev
Author: airwin
Date: 2010-07-23 20:33:05 +0000 (Fri, 23 Jul 2010)
Log Message:
-----------
Commit of Simon's (si...@mu...) donation under the LGPL of a
simple demo of plsmem and the mem device driver under Python.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_mem.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-07-23 16:49:41 UTC (rev 11103)
+++ trunk/examples/python/CMakeLists.txt 2010-07-23 20:33:05 UTC (rev 11104)
@@ -86,6 +86,7 @@
test_gradient.py
test_type1.py
test_hebrew_diacritic.py
+ test_mem.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_mem.py
===================================================================
--- trunk/examples/python/test_mem.py (rev 0)
+++ trunk/examples/python/test_mem.py 2010-07-23 20:33:05 UTC (rev 11104)
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+
+# $Id$
+
+# Copyright (C) 2010 Simon Wood
+
+# Simple demo of plsmem and the mem device under Python.
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import Image
+import math
+import numpy.numarray
+
+from plplot_python_start import *
+
+from plplot import *
+
+# ---------------------------------------------------
+# Build random array (aka fake data)
+
+plseed(1234)
+x=[]
+y=[]
+
+for i in range(500) :
+ x.append(plrandd() * 360)
+ y.append(plrandd() * 90)
+
+# compute binned density on 15' boundaries
+# 360' gives 24 divisions
+# 90' gives 6 divisions
+
+width = 24
+height = 6
+
+max_val = 0
+data = numpy.numarray.zeros((width,height))
+
+for i in range(len(x)):
+ data[int(x[i]/(360/width))][int(y[i]/(90/height))] += 1
+ if data[int(x[i]/(360/width))][int(y[i]/(90/height))] > max_val:
+ max_val +=1
+
+# ---------------------------------------------------
+# Initialise buffer
+
+# Start from a blank canvas
+width = 480
+height = 320
+my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8)
+
+'''
+# Or open an existing image
+# (note 'asarray' will fail as it sees PIL image as an array already and
+# does not perform a copy to make a writable array)
+src_img = Image.open("input.png")
+my_buffer = numpy.array(src_img.convert('RGB'), numpy.uint8)
+(width, height) = src_img.size
+'''
+
+# ---------------------------------------------------
+# Rectangular plot
+
+# initialise for mem driver
+plsmem(width,height,my_buffer)
+plstart ("mem", 1, 1);
+
+plcol0(1)
+plenv(0, 360, 0, 90, 0, 2)
+plcol0(2)
+pllab("Azimuth", "Elevation", "Rectangular Sky View")
+
+# plot binned density
+plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
+
+# plot points
+plpoin(x,y,5)
+
+# Use fromstring as frombuffer will invert the image
+my_image = Image.fromstring("RGB", (width,height), my_buffer)
+my_image.save('output.png')
+plend()
Property changes on: trunk/examples/python/test_mem.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2010-08-24 11:12:41
|
Revision: 11151
http://plplot.svn.sourceforge.net/plplot/?rev=11151&view=rev
Author: andrewross
Date: 2010-08-24 11:12:35 +0000 (Tue, 24 Aug 2010)
Log Message:
-----------
Fix up python scripts to use #!/usr/bin/env python instead of #!python. Most scripts do the latter already and Debian lintian at least warns about the former.
Modified Paths:
--------------
trunk/examples/python/pytkdemo
trunk/examples/python/xtkpy
Modified: trunk/examples/python/pytkdemo
===================================================================
--- trunk/examples/python/pytkdemo 2010-08-24 11:07:53 UTC (rev 11150)
+++ trunk/examples/python/pytkdemo 2010-08-24 11:12:35 UTC (rev 11151)
@@ -1,4 +1,4 @@
-#!python
+#!/usr/bin/env python
# -*-python-*-
# Geoffrey Furnish
#
Modified: trunk/examples/python/xtkpy
===================================================================
--- trunk/examples/python/xtkpy 2010-08-24 11:07:53 UTC (rev 11150)
+++ trunk/examples/python/xtkpy 2010-08-24 11:12:35 UTC (rev 11151)
@@ -1,4 +1,4 @@
-#! python
+#!/usr/bin/env python
# This is a Python/Tk toolbar to run the Python demos. Perhpas
# eventually we will be able to have plframe in a Python/Tk context.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hba...@us...> - 2010-09-22 14:28:51
|
Revision: 11197
http://plplot.svn.sourceforge.net/plplot/?rev=11197&view=rev
Author: hbabcock
Date: 2010-09-22 14:28:41 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
Add a python example of how to use memcairo with and without alpha values.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_memcairo.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-09-22 14:14:07 UTC (rev 11196)
+++ trunk/examples/python/CMakeLists.txt 2010-09-22 14:28:41 UTC (rev 11197)
@@ -87,6 +87,7 @@
test_type1.py
test_hebrew_diacritic.py
test_mem.py
+ test_memcairo.py
)
if(ENABLE_tk)
Added: trunk/examples/python/test_memcairo.py
===================================================================
--- trunk/examples/python/test_memcairo.py (rev 0)
+++ trunk/examples/python/test_memcairo.py 2010-09-22 14:28:41 UTC (rev 11197)
@@ -0,0 +1,129 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2010 Simon Wood
+
+# Simple demo of plsmem, plsmema and the memcairo device under Python.
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import Image
+import math
+import numpy.numarray
+
+from plplot_python_start import *
+
+from plplot import *
+
+# ---------------------------------------------------
+# Build random array (aka fake data)
+
+plseed(1234)
+x=[]
+y=[]
+
+for i in range(500) :
+ x.append(plrandd() * 360)
+ y.append(plrandd() * 90)
+
+# compute binned density on 15' boundaries
+# 360' gives 24 divisions
+# 90' gives 6 divisions
+
+width = 24
+height = 6
+
+max_val = 0
+data = numpy.numarray.zeros((width,height))
+
+for i in range(len(x)):
+ data[int(x[i]/(360/width))][int(y[i]/(90/height))] += 1
+ if data[int(x[i]/(360/width))][int(y[i]/(90/height))] > max_val:
+ max_val +=1
+
+# ---------------------------------------------------
+# Initialise buffer
+
+# Start from a blank canvas
+width = 480
+height = 320
+my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8)
+my_buffer_alpha = numpy.numarray.zeros((height,width,4), numpy.uint8)
+
+'''
+# Or open an existing image
+# (note 'asarray' will fail as it sees PIL image as an array already and
+# does not perform a copy to make a writable array)
+src_img = Image.open("input.png")
+my_buffer = numpy.array(src_img.convert('RGB'), numpy.uint8)
+(width, height) = src_img.size
+'''
+
+# ---------------------------------------------------
+# Rectangular plot w/o alpha values
+
+# initialise for mem driver
+plsmem(width,height,my_buffer)
+plstart ("memcairo", 1, 1);
+
+plcol0(1)
+plenv(0, 360, 0, 90, 0, 2)
+plcol0(2)
+pllab("Azimuth", "Elevation", "Rectangular Sky View")
+
+# plot binned density
+plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
+
+# plot points
+plpoin(x,y,5)
+
+# have to finish plotting so that the plot data gets
+# transferred back from the cairo working surface
+# to the user supplied memory.
+plend1()
+
+# Use fromstring as frombuffer will invert the image
+my_image = Image.fromstring("RGB", (width,height), my_buffer)
+my_image.save('memcairo_RGB.png')
+
+
+# ---------------------------------------------------
+# Rectangular plot with alpha values
+
+# initialise for mem driver
+plsmema(width,height,my_buffer_alpha)
+plstart ("memcairo", 1, 1);
+
+plcol0(1)
+plenv(0, 360, 0, 90, 0, 2)
+plcol0(2)
+pllab("Azimuth", "Elevation", "Rectangular Sky View")
+
+# plot binned density
+plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
+
+# plot points
+plpoin(x,y,5)
+
+# have to finish plotting so that the plot data gets
+# transferred back from the cairo working surface
+# to the user supplied memory.
+plend()
+
+# Use fromstring as frombuffer will invert the image
+my_image = Image.fromstring("RGBA", (width,height), my_buffer_alpha)
+my_image.save('memcairo_RGBA.png')
Property changes on: trunk/examples/python/test_memcairo.py
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-09-23 23:53:56
|
Revision: 11207
http://plplot.svn.sourceforge.net/plplot/?rev=11207&view=rev
Author: airwin
Date: 2010-09-23 23:53:50 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
Change name of test_memcairo.py to test_plsmem.py.in and treat this
file as configurable within CMake. Ignore test_mem.py and test_qt.py
within CMake.
This is the start of amalgamating the functionality of
test_memcairo.py, test_mem.py, and test_qt.py into the configurable
file test_plsmem.py.in, but the functionality of test_mem.py and
test_qt.py have not been amalgamated yet.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/test_plsmem.py.in
Removed Paths:
-------------
trunk/examples/python/test_memcairo.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-09-23 23:23:40 UTC (rev 11206)
+++ trunk/examples/python/CMakeLists.txt 2010-09-23 23:53:50 UTC (rev 11207)
@@ -86,9 +86,6 @@
test_gradient.py
test_type1.py
test_hebrew_diacritic.py
- test_mem.py
- test_memcairo.py
- test_memqt.py
)
if(ENABLE_tk)
@@ -182,6 +179,11 @@
endif(ENABLE_pygcw)
endif(BUILD_TEST)
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/test_plsmem.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_plsmem.py
+ )
+
set(PERM_SCRIPTS
OWNER_READ
OWNER_WRITE
@@ -191,7 +193,7 @@
WORLD_READ
WORLD_EXECUTE
)
- install(FILES ${python_SCRIPTS}
+ install(FILES ${python_SCRIPTS} ${CMAKE_CURRENT_BINARY_DIR}/test_plsmem.py
DESTINATION ${DATA_DIR}/examples/python
PERMISSIONS ${PERM_SCRIPTS}
)
@@ -250,7 +252,7 @@
else(CORE_BUILD)
set_property(GLOBAL PROPERTY FILES_examples_python)
- foreach(file ${python_SCRIPTS} ${python_DATA} plplot_python_start.py plplot_py_demos.py)
+ foreach(file ${python_SCRIPTS} ${python_DATA} plplot_python_start.py plplot_py_demos.py test_plsmem.py)
set_property(GLOBAL APPEND PROPERTY FILES_examples_python
${CMAKE_CURRENT_SOURCE_DIR}/${file}
)
Deleted: trunk/examples/python/test_memcairo.py
===================================================================
--- trunk/examples/python/test_memcairo.py 2010-09-23 23:23:40 UTC (rev 11206)
+++ trunk/examples/python/test_memcairo.py 2010-09-23 23:53:50 UTC (rev 11207)
@@ -1,134 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2010 Simon Wood
-
-# Simple demo of plsmem, plsmema and the memcairo device under Python.
-#
-# This file is part of PLplot.
-#
-# PLplot is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Library Public License as published
-# by the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# PLplot is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with PLplot; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-import Image
-import math
-import numpy.numarray
-
-from plplot_python_start import *
-
-from plplot import *
-
-# ---------------------------------------------------
-# Build random array (aka fake data)
-
-plseed(1234)
-x=[]
-y=[]
-
-for i in range(500) :
- x.append(plrandd() * 360)
- y.append(plrandd() * 90)
-
-# compute binned density on 15' boundaries
-# 360' gives 24 divisions
-# 90' gives 6 divisions
-
-width = 24
-height = 6
-
-max_val = 0
-data = numpy.numarray.zeros((width,height))
-
-for i in range(len(x)):
- data[int(x[i]/(360/width))][int(y[i]/(90/height))] += 1
- if data[int(x[i]/(360/width))][int(y[i]/(90/height))] > max_val:
- max_val +=1
-
-# ---------------------------------------------------
-# Initialise buffer
-
-# Start from a blank canvas
-width = 480
-height = 320
-# Darg gray background (necessarily opaque for RGB format).
-background = numpy.numarray.zeros(3, numpy.uint8) + 30
-my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8) + background
-# Dark gray semi-transparent background.
-background = numpy.numarray.zeros(4, numpy.uint8) + 30
-background[3] = 200
-my_buffer_alpha = numpy.numarray.zeros((height,width,4), numpy.uint8) + background
-
-'''
-# Or open an existing image
-# (note 'asarray' will fail as it sees PIL image as an array already and
-# does not perform a copy to make a writable array)
-src_img = Image.open("input.png")
-my_buffer = numpy.array(src_img.convert('RGB'), numpy.uint8)
-(width, height) = src_img.size
-'''
-
-# ---------------------------------------------------
-# Rectangular plot w/o alpha values
-
-# initialise for mem driver
-plsmem(width,height,my_buffer)
-plstart ("memcairo", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# have to finish plotting so that the plot data gets
-# transferred back from the cairo working surface
-# to the user supplied memory.
-plend1()
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGB", (width,height), my_buffer)
-my_image.save('memcairo_RGB.png')
-
-
-# ---------------------------------------------------
-# Rectangular plot with alpha values
-
-# initialise for mem driver
-plsmema(width,height,my_buffer_alpha)
-plstart ("memcairo", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# have to finish plotting so that the plot data gets
-# transferred back from the cairo working surface
-# to the user supplied memory.
-plend()
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGBA", (width,height), my_buffer_alpha)
-my_image.save('memcairo_RGBA.png')
Copied: trunk/examples/python/test_plsmem.py.in (from rev 11205, trunk/examples/python/test_memcairo.py)
===================================================================
--- trunk/examples/python/test_plsmem.py.in (rev 0)
+++ trunk/examples/python/test_plsmem.py.in 2010-09-23 23:53:50 UTC (rev 11207)
@@ -0,0 +1,134 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2010 Simon Wood
+
+# Simple demo of plsmem, plsmema and the memcairo device under Python.
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import Image
+import math
+import numpy.numarray
+
+from plplot_python_start import *
+
+from plplot import *
+
+# ---------------------------------------------------
+# Build random array (aka fake data)
+
+plseed(1234)
+x=[]
+y=[]
+
+for i in range(500) :
+ x.append(plrandd() * 360)
+ y.append(plrandd() * 90)
+
+# compute binned density on 15' boundaries
+# 360' gives 24 divisions
+# 90' gives 6 divisions
+
+width = 24
+height = 6
+
+max_val = 0
+data = numpy.numarray.zeros((width,height))
+
+for i in range(len(x)):
+ data[int(x[i]/(360/width))][int(y[i]/(90/height))] += 1
+ if data[int(x[i]/(360/width))][int(y[i]/(90/height))] > max_val:
+ max_val +=1
+
+# ---------------------------------------------------
+# Initialise buffer
+
+# Start from a blank canvas
+width = 480
+height = 320
+# Darg gray background (necessarily opaque for RGB format).
+background = numpy.numarray.zeros(3, numpy.uint8) + 30
+my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8) + background
+# Dark gray semi-transparent background.
+background = numpy.numarray.zeros(4, numpy.uint8) + 30
+background[3] = 200
+my_buffer_alpha = numpy.numarray.zeros((height,width,4), numpy.uint8) + background
+
+'''
+# Or open an existing image
+# (note 'asarray' will fail as it sees PIL image as an array already and
+# does not perform a copy to make a writable array)
+src_img = Image.open("input.png")
+my_buffer = numpy.array(src_img.convert('RGB'), numpy.uint8)
+(width, height) = src_img.size
+'''
+
+# ---------------------------------------------------
+# Rectangular plot w/o alpha values
+
+# initialise for mem driver
+plsmem(width,height,my_buffer)
+plstart ("memcairo", 1, 1);
+
+plcol0(1)
+plenv(0, 360, 0, 90, 0, 2)
+plcol0(2)
+pllab("Azimuth", "Elevation", "Rectangular Sky View")
+
+# plot binned density
+plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
+
+# plot points
+plpoin(x,y,5)
+
+# have to finish plotting so that the plot data gets
+# transferred back from the cairo working surface
+# to the user supplied memory.
+plend1()
+
+# Use fromstring as frombuffer will invert the image
+my_image = Image.fromstring("RGB", (width,height), my_buffer)
+my_image.save('memcairo_RGB.png')
+
+
+# ---------------------------------------------------
+# Rectangular plot with alpha values
+
+# initialise for mem driver
+plsmema(width,height,my_buffer_alpha)
+plstart ("memcairo", 1, 1);
+
+plcol0(1)
+plenv(0, 360, 0, 90, 0, 2)
+plcol0(2)
+pllab("Azimuth", "Elevation", "Rectangular Sky View")
+
+# plot binned density
+plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
+
+# plot points
+plpoin(x,y,5)
+
+# have to finish plotting so that the plot data gets
+# transferred back from the cairo working surface
+# to the user supplied memory.
+plend()
+
+# Use fromstring as frombuffer will invert the image
+my_image = Image.fromstring("RGBA", (width,height), my_buffer_alpha)
+my_image.save('memcairo_RGBA.png')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-09-24 03:30:34
|
Revision: 11208
http://plplot.svn.sourceforge.net/plplot/?rev=11208&view=rev
Author: airwin
Date: 2010-09-24 03:30:28 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Incorporate test_memqt.py and test_mem.py logic into
test_plsmem.py(.in) by configuring an available plsmem-related device
list and doing all plotting for both RGB and RGBA for each available
device using a python function to simplify the logic.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
trunk/examples/python/test_plsmem.py.in
Removed Paths:
-------------
trunk/examples/python/test_mem.py
trunk/examples/python/test_memqt.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-09-23 23:53:50 UTC (rev 11207)
+++ trunk/examples/python/CMakeLists.txt 2010-09-24 03:30:28 UTC (rev 11208)
@@ -179,11 +179,22 @@
endif(ENABLE_pygcw)
endif(BUILD_TEST)
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/test_plsmem.py.in
- ${CMAKE_CURRENT_BINARY_DIR}/test_plsmem.py
- )
+ set(PLSMEM_DEVICE_LIST)
+ foreach(memdriver mem memcairo memqt)
+ if(PLD_${memdriver})
+ list(APPEND PLSMEM_DEVICE_LIST ${memdriver})
+ endif(PLD_${memdriver})
+ endforeach(memdriver mem memcairo memqt)
+ if(PLSMEM_DEVICE_LIST)
+ string(REGEX REPLACE ";" "\", \"" PLSMEM_DEVICE_LIST "${PLSMEM_DEVICE_LIST}")
+ set(PLSMEM_DEVICE_LIST "[\"${PLSMEM_DEVICE_LIST}\"]")
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/test_plsmem.py.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_plsmem.py
+ )
+ endif(PLSMEM_DEVICE_LIST)
+
set(PERM_SCRIPTS
OWNER_READ
OWNER_WRITE
Deleted: trunk/examples/python/test_mem.py
===================================================================
--- trunk/examples/python/test_mem.py 2010-09-23 23:53:50 UTC (rev 11207)
+++ trunk/examples/python/test_mem.py 2010-09-24 03:30:28 UTC (rev 11208)
@@ -1,98 +0,0 @@
-#!/usr/bin/env python
-
-# $Id$
-
-# Copyright (C) 2010 Simon Wood
-
-# Simple demo of plsmem and the mem device under Python.
-#
-# This file is part of PLplot.
-#
-# PLplot is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Library Public License as published
-# by the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# PLplot is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with PLplot; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-import Image
-import math
-import numpy.numarray
-
-from plplot_python_start import *
-
-from plplot import *
-
-# ---------------------------------------------------
-# Build random array (aka fake data)
-
-plseed(1234)
-x=[]
-y=[]
-
-for i in range(500) :
- x.append(plrandd() * 360)
- y.append(plrandd() * 90)
-
-# compute binned density on 15' boundaries
-# 360' gives 24 divisions
-# 90' gives 6 divisions
-
-width = 24
-height = 6
-
-max_val = 0
-data = numpy.numarray.zeros((width,height))
-
-for i in range(len(x)):
- data[int(x[i]/(360/width))][int(y[i]/(90/height))] += 1
- if data[int(x[i]/(360/width))][int(y[i]/(90/height))] > max_val:
- max_val +=1
-
-# ---------------------------------------------------
-# Initialise buffer
-
-# Start from a blank canvas
-width = 480
-height = 320
-my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8)
-
-'''
-# Or open an existing image
-# (note 'asarray' will fail as it sees PIL image as an array already and
-# does not perform a copy to make a writable array)
-src_img = Image.open("input.png")
-my_buffer = numpy.array(src_img.convert('RGB'), numpy.uint8)
-(width, height) = src_img.size
-'''
-
-# ---------------------------------------------------
-# Rectangular plot
-
-# initialise for mem driver
-plsmem(width,height,my_buffer)
-plstart ("mem", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGB", (width,height), my_buffer)
-my_image.save('output.png')
-plend()
Deleted: trunk/examples/python/test_memqt.py
===================================================================
--- trunk/examples/python/test_memqt.py 2010-09-23 23:53:50 UTC (rev 11207)
+++ trunk/examples/python/test_memqt.py 2010-09-24 03:30:28 UTC (rev 11208)
@@ -1,134 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2010 Simon Wood
-
-# Simple demo of plsmem, plsmema and the memcairo device under Python.
-#
-# This file is part of PLplot.
-#
-# PLplot is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Library Public License as published
-# by the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# PLplot is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with PLplot; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-import Image
-import math
-import numpy.numarray
-
-from plplot_python_start import *
-
-from plplot import *
-
-# ---------------------------------------------------
-# Build random array (aka fake data)
-
-plseed(1234)
-x=[]
-y=[]
-
-for i in range(500) :
- x.append(plrandd() * 360)
- y.append(plrandd() * 90)
-
-# compute binned density on 15' boundaries
-# 360' gives 24 divisions
-# 90' gives 6 divisions
-
-width = 24
-height = 6
-
-max_val = 0
-data = numpy.numarray.zeros((width,height))
-
-for i in range(len(x)):
- data[int(x[i]/(360/width))][int(y[i]/(90/height))] += 1
- if data[int(x[i]/(360/width))][int(y[i]/(90/height))] > max_val:
- max_val +=1
-
-# ---------------------------------------------------
-# Initialise buffer
-
-# Start from a blank canvas
-width = 480
-height = 320
-# Darg gray background (necessarily opaque for RGB format).
-background = numpy.numarray.zeros(3, numpy.uint8) + 30
-my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8) + background
-# Dark gray semi-transparent background.
-background = numpy.numarray.zeros(4, numpy.uint8) + 30
-background[3] = 200
-my_buffer_alpha = numpy.numarray.zeros((height,width,4), numpy.uint8) + background
-
-'''
-# Or open an existing image
-# (note 'asarray' will fail as it sees PIL image as an array already and
-# does not perform a copy to make a writable array)
-src_img = Image.open("input.png")
-my_buffer = numpy.array(src_img.convert('RGB'), numpy.uint8)
-(width, height) = src_img.size
-'''
-
-# ---------------------------------------------------
-# Rectangular plot w/o alpha values
-
-# initialise for mem driver
-plsmem(width,height,my_buffer)
-plstart ("memqt", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# have to finish plotting so that the plot data gets
-# transferred back from the cairo working surface
-# to the user supplied memory.
-plend1()
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGB", (width,height), my_buffer)
-my_image.save('memqt_RGB.png')
-
-
-# ---------------------------------------------------
-# Rectangular plot with alpha values
-
-# initialise for mem driver
-plsmema(width,height,my_buffer_alpha)
-plstart ("memqt", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# have to finish plotting so that the plot data gets
-# transferred back from the cairo working surface
-# to the user supplied memory.
-plend()
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGBA", (width,height), my_buffer_alpha)
-my_image.save('memqt_RGBA.png')
Modified: trunk/examples/python/test_plsmem.py.in
===================================================================
--- trunk/examples/python/test_plsmem.py.in 2010-09-23 23:53:50 UTC (rev 11207)
+++ trunk/examples/python/test_plsmem.py.in 2010-09-24 03:30:28 UTC (rev 11208)
@@ -1,8 +1,11 @@
#!/usr/bin/env python
# Copyright (C) 2010 Simon Wood
+# Copyright (C) 2010 Hazen Babcock
+# Copyright (C) Alan W. Irwin
-# Simple demo of plsmem, plsmema and the memcairo device under Python.
+# Simple amalgamated demo of plsmem and plsmema under Python for the
+# mem, memcairo, and memqt devices.
#
# This file is part of PLplot.
#
@@ -29,6 +32,37 @@
from plplot import *
+def plot(device_name, ifRGBA, width, height, my_buffer, x, y, data, max_val):
+ if ifRGBA:
+ colour_code = "RGBA"
+ # initialise for mem-style RGBA device
+ plsmema(width,height,my_buffer)
+ else:
+ colour_code = "RGB"
+ # initialise for mem-style RGB device
+ plsmem(width,height,my_buffer)
+
+ plstart (device_name, 1, 1);
+
+ plcol0(2)
+ plenv(0, 360, 0, 90, 0, 2)
+ plcol0(2)
+ pllab("Azimuth", "Elevation", "Rectangular Sky View with " + colour_code + " " + device_name + " device")
+
+ # plot binned density
+ plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
+
+ # plot points
+ plpoin(x,y,5)
+
+ # have to finish plotting so that the plot data gets transferred
+ # back from the cairo working surface to the user supplied memory.
+ plend1()
+
+ # Use fromstring as frombuffer will invert the image
+ my_image = Image.fromstring(colour_code, (width,height), my_buffer)
+ my_image.save(device_name + "_" + colour_code + ".png")
+
# ---------------------------------------------------
# Build random array (aka fake data)
@@ -61,13 +95,15 @@
# Start from a blank canvas
width = 480
height = 320
-# Darg gray background (necessarily opaque for RGB format).
+
+# Dark gray background (necessarily opaque for RGB format).
background = numpy.numarray.zeros(3, numpy.uint8) + 30
my_buffer = numpy.numarray.zeros((height,width,3), numpy.uint8) + background
+
# Dark gray semi-transparent background.
background = numpy.numarray.zeros(4, numpy.uint8) + 30
background[3] = 200
-my_buffer_alpha = numpy.numarray.zeros((height,width,4), numpy.uint8) + background
+my_buffera = numpy.numarray.zeros((height,width,4), numpy.uint8) + background
'''
# Or open an existing image
@@ -78,57 +114,14 @@
(width, height) = src_img.size
'''
-# ---------------------------------------------------
-# Rectangular plot w/o alpha values
-
-# initialise for mem driver
-plsmem(width,height,my_buffer)
-plstart ("memcairo", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# have to finish plotting so that the plot data gets
-# transferred back from the cairo working surface
-# to the user supplied memory.
-plend1()
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGB", (width,height), my_buffer)
-my_image.save('memcairo_RGB.png')
-
-
-# ---------------------------------------------------
-# Rectangular plot with alpha values
-
-# initialise for mem driver
-plsmema(width,height,my_buffer_alpha)
-plstart ("memcairo", 1, 1);
-
-plcol0(1)
-plenv(0, 360, 0, 90, 0, 2)
-plcol0(2)
-pllab("Azimuth", "Elevation", "Rectangular Sky View")
-
-# plot binned density
-plimage(data, 0, 360, 0, 90, 0, max_val, 0, 360, 0, 90)
-
-# plot points
-plpoin(x,y,5)
-
-# have to finish plotting so that the plot data gets
-# transferred back from the cairo working surface
-# to the user supplied memory.
-plend()
-
-# Use fromstring as frombuffer will invert the image
-my_image = Image.fromstring("RGBA", (width,height), my_buffer_alpha)
-my_image.save('memcairo_RGBA.png')
+# Configured device_list depends on what plsmem and plsmema devices
+# are available from the PLplot build.
+device_list = @PLSMEM_DEVICE_LIST@
+for device_name in device_list:
+ # plot writes on top of buffer each time so must use an independent (deep) copy.
+ buffer = numpy.array(my_buffer,copy=True)
+ plot(device_name, False, width, height, buffer, x, y, data, max_val)
+ # "mem" device does not (yet) have RGBA capability.
+ if device_name != "mem":
+ buffer = numpy.array(my_buffera,copy=True)
+ plot(device_name, True, width, height, buffer, x, y, data, max_val)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-11-10 02:12:41
|
Revision: 11312
http://plplot.svn.sourceforge.net/plplot/?rev=11312&view=rev
Author: airwin
Date: 2010-11-10 02:12:35 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
Propagate plstring and new version of pllegend to python examples.
Examples 4 and 26 in python mimic the corresponding C results.
Modified Paths:
--------------
trunk/examples/python/xw04.py
trunk/examples/python/xw26.py
Modified: trunk/examples/python/xw04.py
===================================================================
--- trunk/examples/python/xw04.py 2010-11-10 02:11:28 UTC (rev 11311)
+++ trunk/examples/python/xw04.py 2010-11-10 02:12:35 UTC (rev 11312)
@@ -74,7 +74,7 @@
plbox("", 0.0, 0, "cmstv", 30.0, 3)
plcol0(3)
plline(freql, phase)
- plpoin(freql, phase, 3)
+ plstring(freql, phase, "*")
plcol0(3)
plmtex("r", 5.0, 0.5, 0.5, "Phase shift (degrees)")
nlegend = 2
@@ -95,7 +95,7 @@
symbol_colors = zeros(nlegend, "int")
symbol_scales = zeros(nlegend)
symbol_numbers = zeros(nlegend, "int")
- symbols = zeros(nlegend, "int")
+ symbols = zeros(nlegend, "S10")
# Only specify legend data that are required according to the
# value of opt_array for that entry.
@@ -118,15 +118,14 @@
symbol_colors[1] = 3
symbol_scales[1] = 1.
symbol_numbers[1] = 4
- symbols[1] = 3
+ symbols[1] = "*"
- plscol0a( 15, 32, 32, 32, 0.90 )
-# pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15,
-# opt_array,
-# 1.0, 1.0, 2.0,
-# 1., text_colors, text,
-# box_colors, box_patterns, box_scales,
-# line_colors, line_styles, line_widths,
-# symbol_colors, symbol_scales, symbol_numbers, symbols )
+ plscol0a( 15, 32, 32, 32, 0.70 )
+ pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0,
+ 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0,
+ 1., text_colors, text, box_colors, box_patterns,
+ box_scales, line_colors, line_styles, line_widths,
+ symbol_colors, symbol_scales, symbol_numbers, symbols )
+
main()
Modified: trunk/examples/python/xw26.py
===================================================================
--- trunk/examples/python/xw26.py 2010-11-10 02:11:28 UTC (rev 11311)
+++ trunk/examples/python/xw26.py 2010-11-10 02:12:35 UTC (rev 11312)
@@ -142,7 +142,7 @@
plbox("", 0.0, 0, "cmstv", 30.0, 3)
plcol0(3)
plline(freql, phase)
- plpoin(freql, phase, 3)
+ plstring(freql, phase, "*")
plcol0(3)
plmtex("r", 5.0, 0.5, 0.5, alty_label)
nlegend = 2
@@ -165,7 +165,7 @@
symbol_colors = zeros(nlegend, "int")
symbol_scales = zeros(nlegend)
symbol_numbers = zeros(nlegend, "int")
- symbols = zeros(nlegend, "int")
+ symbols = zeros(nlegend, "S10")
# Only specify legend data that are required according to the
# value of opt_array for that entry.
@@ -188,16 +188,15 @@
symbol_colors[1] = 3
symbol_scales[1] = 1.
symbol_numbers[1] = 4
- symbols[1] = 3
+ symbols[1] = "*"
- plscol0a( 15, 32, 32, 32, 0.90 )
-# pllegend( PL_LEGEND_BACKGROUND, 0.57, 0.85, 0.06, 15,
-# opt_array,
-# 1.0, 1.0, 2.0,
-# 1., text_colors, text,
-# box_colors, box_patterns, box_scales,
-# line_colors, line_styles, line_widths,
-# symbol_colors, symbol_scales, symbol_numbers, symbols )
+ plscol0a( 15, 32, 32, 32, 0.70 )
+ pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0,
+ 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0,
+ 1., text_colors, text, box_colors, box_patterns,
+ box_scales, line_colors, line_styles, line_widths,
+ symbol_colors, symbol_scales, symbol_numbers, symbols )
+
main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-11-10 16:48:21
|
Revision: 11315
http://plplot.svn.sourceforge.net/plplot/?rev=11315&view=rev
Author: airwin
Date: 2010-11-10 16:48:15 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
Initial commit of example 33 which is meant to exercise the pllegend
(and plcolorbar when that is done) capabilities. This is only the
first page of this example which demonstrates the pllegend positioning
capability for the 16 standard positions with uniform offsets in x and
y. N.B. much more to come so do not propagate to C and other
non-Python languages for the time being.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
Added Paths:
-----------
trunk/examples/python/x33
trunk/examples/python/xw33.py
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-11-10 07:55:56 UTC (rev 11314)
+++ trunk/examples/python/CMakeLists.txt 2010-11-10 16:48:15 UTC (rev 11315)
@@ -24,7 +24,8 @@
# and CORE_BUILD always ON. The installed examples build always has
# BUILD_TEST ON and CORE_BUILD OFF.
-# N.B. examples 14 and 17 handled independently.
+# N.B. examples 14, 17, and 31 handled independently while 32 has
+# not yet been implemented.
set(python_STRING_INDICES
"01"
"02"
@@ -54,6 +55,7 @@
"28"
"29"
"30"
+ "33"
)
set(python_SCRIPTS)
Added: trunk/examples/python/x33
===================================================================
--- trunk/examples/python/x33 (rev 0)
+++ trunk/examples/python/x33 2010-11-10 16:48:15 UTC (rev 11315)
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2004 Alan W. Irwin
+# Copyright (C) 2004 Andrew Ross
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; version 2 of the License.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with the file PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+# Run all python plplot examples non-interactively.
+
+# Append to effective python path so that can find plplot modules.
+from plplot_python_start import *
+
+import sys
+from plplot import *
+
+# Parse and process command line arguments
+plparseopts(sys.argv, PL_PARSE_FULL)
+
+# Initialize plplot
+plinit()
+
+import xw33
+
+# Terminate plplot
+plend()
Property changes on: trunk/examples/python/x33
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/examples/python/xw33.py
===================================================================
--- trunk/examples/python/xw33.py (rev 0)
+++ trunk/examples/python/xw33.py 2010-11-10 16:48:15 UTC (rev 11315)
@@ -0,0 +1,102 @@
+# -*- coding: utf-8; -*-
+# $Id$
+# Copyright (C) 2006-2010 Alan W. Irwin
+
+# Demonstrate most pllegend capability including unicode symbols.
+
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# This example designed just for devices (e.g., the cairo-related and
+# qt-related devices) where the best choice of glyph is automatically
+# selected by the related libraries (pango/cairo or Qt4) for each
+# unicode character depending on what system fonts are installed. Of
+# course, you must have the appropriate TrueType fonts installed to
+# have access to all the required glyphs.
+
+from plplot_py_demos import *
+
+position_options = [
+PL_LEGEND_LEFT | PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE,
+PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE,
+PL_LEGEND_RIGHT | PL_LEGEND_UPPER | PL_LEGEND_OUTSIDE,
+PL_LEGEND_RIGHT| PL_LEGEND_OUTSIDE,
+PL_LEGEND_RIGHT | PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE,
+PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE,
+PL_LEGEND_LEFT | PL_LEGEND_LOWER | PL_LEGEND_OUTSIDE,
+PL_LEGEND_LEFT | PL_LEGEND_OUTSIDE,
+PL_LEGEND_LEFT | PL_LEGEND_UPPER | PL_LEGEND_INSIDE,
+PL_LEGEND_UPPER | PL_LEGEND_INSIDE,
+PL_LEGEND_RIGHT | PL_LEGEND_UPPER | PL_LEGEND_INSIDE,
+PL_LEGEND_RIGHT| PL_LEGEND_INSIDE,
+PL_LEGEND_RIGHT | PL_LEGEND_LOWER | PL_LEGEND_INSIDE,
+PL_LEGEND_LOWER | PL_LEGEND_INSIDE,
+PL_LEGEND_LEFT | PL_LEGEND_LOWER | PL_LEGEND_INSIDE,
+PL_LEGEND_LEFT | PL_LEGEND_INSIDE,
+]
+
+def main():
+ pladv(0)
+ plvpor(0.25, 0.75, 0.25, 0.75)
+ plwind(0.0, 1.0, 0.0, 1.0)
+ plbox("bc", 0.0, 0, "bc", 0.0, 0)
+ plmtex("t", 7.5, 0.5, 0.5, "The 16 standard legend positions with")
+ plmtex("t", 6., 0.5, 0.5, "the same (0.05) offset in x and y")
+
+ # Set up legend arrays with the correct size, type.
+ nlegend = 1
+ opt_array = zeros(nlegend, "int")
+ text_colors = zeros(nlegend, "int")
+ text = zeros(nlegend, "S200")
+ box_colors = zeros(nlegend, "int")
+ box_patterns = zeros(nlegend, "int")
+ box_scales = zeros(nlegend)
+ line_colors = zeros(nlegend, "int")
+ line_styles = zeros(nlegend, "int")
+ line_widths = zeros(nlegend, "int")
+ symbol_colors = zeros(nlegend, "int")
+ symbol_scales = zeros(nlegend)
+ symbol_numbers = zeros(nlegend, "int")
+ symbols = zeros(nlegend, "S100")
+
+ # Only specify legend data that are required according to the
+ # value of opt_array for that entry.
+ opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX
+ opt_array[0] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL
+ line_styles[0] = 1
+ line_widths[0] = 1
+ symbol_scales[0] = 1.
+ symbol_numbers[0] = 4
+ symbols[0] = "*"
+
+ # Use monotype fonts so that all legends are the same size.
+ plsfont(PL_FCI_MONO, -1, -1)
+ plscol0a( 15, 32, 32, 32, 0.70 )
+
+ for k in range(16):
+ opt = opt_base | position_options[k]
+ text[0] = "%2.2d" % k
+ text_colors[0] = 1 + (k % 8)
+ line_colors[0] = 1 + (k % 8)
+ symbol_colors[0] = 1 + (k % 8)
+
+ pllegend( opt, 0.05, 0.05,
+ 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0,
+ 1., text_colors, text, box_colors, box_patterns,
+ box_scales, line_colors, line_styles, line_widths,
+ symbol_colors, symbol_scales, symbol_numbers, symbols )
+
+main()
Property changes on: trunk/examples/python/xw33.py
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-11-10 17:00:23
|
Revision: 11316
http://plplot.svn.sourceforge.net/plplot/?rev=11316&view=rev
Author: airwin
Date: 2010-11-10 17:00:15 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
Update properties to be uniform with the remaining x?? files.
Property Changed:
----------------
trunk/examples/python/x20
trunk/examples/python/x21
trunk/examples/python/x25
trunk/examples/python/x29
trunk/examples/python/x30
Property changes on: trunk/examples/python/x20
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/examples/python/x21
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/examples/python/x25
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/examples/python/x29
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/examples/python/x30
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-11-11 10:34:25
|
Revision: 11322
http://plplot.svn.sourceforge.net/plplot/?rev=11322&view=rev
Author: airwin
Date: 2010-11-11 10:34:19 +0000 (Thu, 11 Nov 2010)
Log Message:
-----------
Get rid of syntax error for line that should be continued.
Modified Paths:
--------------
trunk/examples/python/xw04.py
trunk/examples/python/xw26.py
Modified: trunk/examples/python/xw04.py
===================================================================
--- trunk/examples/python/xw04.py 2010-11-11 08:33:39 UTC (rev 11321)
+++ trunk/examples/python/xw04.py 2010-11-11 10:34:19 UTC (rev 11322)
@@ -122,7 +122,7 @@
plscol0a( 15, 32, 32, 32, 0.70 )
- (legend_width, legend_height) =
+ (legend_width, legend_height) = \
pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0,
0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0,
1., text_colors, text, box_colors, box_patterns,
Modified: trunk/examples/python/xw26.py
===================================================================
--- trunk/examples/python/xw26.py 2010-11-11 08:33:39 UTC (rev 11321)
+++ trunk/examples/python/xw26.py 2010-11-11 10:34:19 UTC (rev 11322)
@@ -192,7 +192,7 @@
plscol0a( 15, 32, 32, 32, 0.70 )
- (legend_width, legend_height) =
+ (legend_width, legend_height) = \
pllegend( PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0.0, 0.0,
0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0,
1., text_colors, text, box_colors, box_patterns,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2010-12-13 01:41:29
|
Revision: 11370
http://plplot.svn.sourceforge.net/plplot/?rev=11370&view=rev
Author: airwin
Date: 2010-12-13 01:41:21 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Configure the location of the PLplot python modules in the build tree
for the Windows case. This fix allows Python to give good test
results (for the most part) on my MinGW/MSYS/wine test platform.
Modified Paths:
--------------
trunk/examples/python/CMakeLists.txt
trunk/examples/python/plplot_python_start.py.cmake
Modified: trunk/examples/python/CMakeLists.txt
===================================================================
--- trunk/examples/python/CMakeLists.txt 2010-12-13 01:22:00 UTC (rev 11369)
+++ trunk/examples/python/CMakeLists.txt 2010-12-13 01:41:21 UTC (rev 11370)
@@ -227,8 +227,13 @@
set(python_location1 ${CMAKE_SOURCE_DIR}/bindings/python)
set(python_location2 ${CMAKE_BINARY_DIR}/bindings/python)
- set(python_location3 ${CMAKE_BINARY_DIR}/bindings/qt_gui/pyqt4)
- set(python_location4 ${CMAKE_BINARY_DIR}/bindings/gnome2/python)
+ if(WIN32 AND NOT CYGWIN)
+ set(python_location3 ${CMAKE_BINARY_DIR}/dll)
+ else(WIN32 AND NOT CYGWIN)
+ set(python_location3)
+ endif(WIN32 AND NOT CYGWIN)
+ set(python_location4 ${CMAKE_BINARY_DIR}/bindings/qt_gui/pyqt4)
+ set(python_location5 ${CMAKE_BINARY_DIR}/bindings/gnome2/python)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/plplot_python_start.py.cmake
${CMAKE_CURRENT_BINARY_DIR}/plplot_python_start.py
@@ -239,6 +244,7 @@
set(python_location2)
set(python_location3)
set(python_location4)
+ set(python_location5)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/plplot_python_start.py.cmake
${CMAKE_CURRENT_BINARY_DIR}/plplot_python_start.py_install
Modified: trunk/examples/python/plplot_python_start.py.cmake
===================================================================
--- trunk/examples/python/plplot_python_start.py.cmake 2010-12-13 01:22:00 UTC (rev 11369)
+++ trunk/examples/python/plplot_python_start.py.cmake 2010-12-13 01:41:21 UTC (rev 11370)
@@ -2,10 +2,10 @@
# depending on how python_location[12] are set.
# Note, by careful choice of python_location[12] for the build-tree
# case and the install tree case you can achieve
-# a clear separation between build and install tree with the current CBS
-# that is not possible with the current ABS system.
+# a clear separation between build and install tree case.
import sys
sys.path.insert (0, "@python_location1@")
sys.path.insert (0, "@python_location2@")
sys.path.insert (0, "@python_location3@")
sys.path.insert (0, "@python_location4@")
+sys.path.insert (0, "@python_location5@")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-03-19 21:21:30
|
Revision: 11654
http://plplot.svn.sourceforge.net/plplot/?rev=11654&view=rev
Author: airwin
Date: 2011-03-19 21:21:23 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
Untested minimal maintenance (plcol ==> plcol0) for all these old
examples.
Modified Paths:
--------------
trunk/examples/python/x01.py
trunk/examples/python/x02.py
trunk/examples/python/x03.py
trunk/examples/python/x04.py
trunk/examples/python/x05.py
trunk/examples/python/x06.py
trunk/examples/python/x07.py
trunk/examples/python/x08.py
trunk/examples/python/x09.py
trunk/examples/python/x11.py
trunk/examples/python/x12.py
trunk/examples/python/x13.py
trunk/examples/python/x16.py
Modified: trunk/examples/python/x01.py
===================================================================
--- trunk/examples/python/x01.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x01.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -137,19 +137,19 @@
# are scaled separately (just = 0), and we just draw a
# labelled box (axis = 0).
- w.plcol(1)
+ w.plcol0(1)
w.plenv(xmin, xmax, ymin, ymax, 0, 0)
- w.plcol(2)
+ w.plcol0(2)
w.pllab("(x)", "(y)", "#frPLplot Example 1 - y=x#u2")
# Plot the data points
- w.plcol(4)
+ w.plcol0(4)
w.plpoin(xs, ys, 9)
# Draw the line through the data
- w.plcol(3)
+ w.plcol0(3)
w.plline(x, y)
w.pleop()
@@ -170,9 +170,9 @@
## pl.env(-2.0, 10.0, -0.4, 1.2, 0, 1)
## pl.col(2)
## pl.lab("(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function")
- w.plcol(1)
+ w.plcol0(1)
w.plenv(-2.0, 10.0, -0.4, 1.2, 0, 1)
- w.plcol(2)
+ w.plcol0(2)
w.pllab("(x)", "sin(x)/x", "#frPLplot Example 1 - Sinc Function")
# Fill up the arrays
@@ -198,7 +198,7 @@
## pl.col(3)
## pl.line(x, y)
- w.plcol(3)
+ w.plcol0(3)
w.plline(x, y)
w.pleop()
@@ -222,18 +222,18 @@
# Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y.
- w.plcol(1)
+ w.plcol0(1)
w.plbox("bcnst", 60.0, 2, "bcnstv", 0.2, 2)
# Superimpose a dashed line grid, with 1.5 mm marks and spaces.
# plstyl expects a pointer!!
#w.plstyl([1500], [1500])
- w.plcol(2)
+ w.plcol0(2)
w.plbox("g", 30.0, 0, "g", 0.2, 0)
#w.plstyl([], [])
- w.plcol(3)
+ w.plcol0(3)
w.pllab("Angle (degrees)", "sine",
"#frPLplot Example 1 - Sine function")
@@ -247,7 +247,7 @@
x[i] = 3.6 * i
y[i] = math.sin(x[i] * math.pi / 180.0)
- w.plcol(4)
+ w.plcol0(4)
w.plline(x, y)
w.pleop()
Modified: trunk/examples/python/x02.py
===================================================================
--- trunk/examples/python/x02.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x02.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -36,7 +36,7 @@
w.plfont(4)
for i in range(16):
- w.plcol(i)
+ w.plcol0(i)
w.pladv(0)
vmin = 0.1
vmax = 0.9
Modified: trunk/examples/python/x03.py
===================================================================
--- trunk/examples/python/x03.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x03.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -38,7 +38,7 @@
## pl.init()
- w.plcol(1)
+ w.plcol0(1)
# Set up viewport and window, but do not draw box
@@ -56,7 +56,7 @@
w.plline(x, y)
- w.plcol(2)
+ w.plcol0(2)
for i in range(12):
theta = 30.0 * i
dx = math.cos(dtr * theta)
@@ -82,10 +82,10 @@
x[i] = x0[i] * r
y[i] = y0[i] * r
- w.plcol(3)
+ w.plcol0(3)
w.plline(x, y)
- w.plcol(4)
+ w.plcol0(4)
w.plmtex("t", 2.0, 0.5, 0.5, "#frPLplot Example 3 - r(#gh)=sin 5#gh")
# Close the plot at end
Modified: trunk/examples/python/x04.py
===================================================================
--- trunk/examples/python/x04.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x04.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -53,24 +53,24 @@
w.plvpor(0.15, 0.85, 0.1, 0.9)
w.plwind(1.0, 6.0, -80.0, 0.0)
- w.plcol(1)
+ w.plcol0(1)
w.plbox("bclnst", 0.0, 0, "bnstv", 0.0, 0)
- w.plcol(2)
+ w.plcol0(2)
w.plline(freql, ampl)
- w.plcol(1)
+ w.plcol0(1)
w.plptex(5.0, -30.0, 1.0, -20.0, 0.5, "-20 dB/decade")
w.plwind(1.0, 6.0, -100.0, 0.0)
w.plbox("", 0.0, 0, "cmstv", 30.0, 3)
- w.plcol(3)
+ w.plcol0(3)
w.plline(freql, phase)
- w.plcol(1)
+ w.plcol0(1)
w.plmtex("b", 3.2, 0.5, 0.5, "Frequency")
w.plmtex("t", 2.0, 0.5, 0.5, "Single Pole Low-Pass Filter")
- w.plcol(2)
+ w.plcol0(2)
w.plmtex("l", 5.0, 0.5, 0.5, "Amplitude (dB)")
- w.plcol(3)
+ w.plcol0(3)
w.plmtex("r", 5.0, 0.5, 0.5, "Phase shift (degrees)")
w.pleop()
Modified: trunk/examples/python/x05.py
===================================================================
--- trunk/examples/python/x05.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x05.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -41,9 +41,9 @@
for i in range(NPTS):
data[i] = math.sin(i * delta)
- w.plcol(1)
+ w.plcol0(1)
w.plhist(data, -1.1, 1.1, 44, 0)
- w.plcol(2)
+ w.plcol0(2)
w.pllab("#frValue", "#frFrequency",
"#frPLplot Example 5 - Probability function of Oscillator")
Modified: trunk/examples/python/x06.py
===================================================================
--- trunk/examples/python/x06.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x06.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -33,7 +33,7 @@
# Set up viewport and window
- w.plcol(2)
+ w.plcol0(2)
w.plvpor(0.1, 1.0, 0.1, 0.9)
w.plwind(0.0, 1.0, 0.0, 1.3)
@@ -43,7 +43,7 @@
# Write the digits below the frame
- w.plcol(15)
+ w.plcol0(15)
for i in range(10):
w.plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
Modified: trunk/examples/python/x07.py
===================================================================
--- trunk/examples/python/x07.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x07.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -39,7 +39,7 @@
# Set up viewport and window
- w.plcol(2)
+ w.plcol0(2)
w.plvpor(0.15, 0.95, 0.1, 0.9)
w.plwind(0.0, 1.0, 0.0, 1.0)
@@ -49,7 +49,7 @@
# Write the digits below the frame
- w.plcol(15)
+ w.plcol0(15)
for i in range(10):
w.plmtex("b", 1.5, (0.1 * i + 0.05), 0.5, `i`)
Modified: trunk/examples/python/x08.py
===================================================================
--- trunk/examples/python/x08.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x08.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -74,16 +74,16 @@
w.pladv(0)
w.plvpor(0.0, 1.0, 0.0, 0.9)
w.plwind(-1.0, 1.0, -0.9, 1.1)
- w.plcol(1)
+ w.plcol0(1)
w.plw3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0,
alt[k], az[k])
w.plbox3("bnstu", "x axis", 0.0, 0,
"bnstu", "y axis", 0.0, 0,
"bcdmnstuv", "z axis", 0.0, 0)
- w.plcol(2)
+ w.plcol0(2)
w.plot3d(x, y, z, opt[k], 1)
- w.plcol(3)
+ w.plcol0(3)
w.plmtex("t", 1.0, 0.5, 0.5, title[k])
w.pleop()
Modified: trunk/examples/python/x09.py
===================================================================
--- trunk/examples/python/x09.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x09.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -131,31 +131,31 @@
##/* plenv(-1.0, 1.0, -1.0, 1.0, 0, 0);
## */
## plenv(.0, 1.*XPTS, .0, 1.*YPTS, 0, 0);
-## plcol(2);
+## plcol0(2);
##/* plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL);
## */
## plcont(z, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, pltr0, NULL);
## plstyl(1, &mark, &space);
-## plcol(3);
+## plcol0(3);
##/* plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, mypltr, NULL);
## */
## plcont(w, XPTS, YPTS, 1, XPTS, 1, YPTS, clevel, 11, pltr0, NULL);
## plstyl(0, &mark, &space);
-## plcol(1);
+## plcol0(1);
## pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
plenv( 0., 1.*xpts, 0., 1.*ypts, 0, 0 )
- plcol(2)
+ plcol0(2)
plcont2( z, 1, xpts, 1, ypts, clevel )
plstyl( 1, mark, space )
- plcol(3)
+ plcol0(3)
plcont2( w, 1, 1.*xpts, 1, 1.*ypts, clevel )
plstyl( 0, mark, space )
# other stuff
- plcol(1)
+ plcol0(1)
pllab("X Coordinate", "Y Coordinate", "Streamlines of flow");
pleop()
Modified: trunk/examples/python/x11.py
===================================================================
--- trunk/examples/python/x11.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x11.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -72,7 +72,7 @@
for k in range(4):
w.pladv(0)
- w.plcol(1)
+ w.plcol0(1)
w.plvpor(0.0, 1.0, 0.0, 0.8)
w.plwind(-1.0, 1.0, -1.0, 1.5)
@@ -82,9 +82,9 @@
"bnstu", "y axis", 0.0, 0,
"bcdmnstuv", "z axis", 0.0, 4)
- w.plcol(2)
+ w.plcol0(2)
w.plmesh(x, y, z, opt[k])
- w.plcol(3)
+ w.plcol0(3)
w.plmtex("t", 1.0, 0.5, 0.5, title[k])
w.pleop()
Modified: trunk/examples/python/x12.py
===================================================================
--- trunk/examples/python/x12.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x12.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -33,13 +33,13 @@
w.plvsta()
w.plwind(1980.0, 1990.0, 0.0, 35.0)
w.plbox("bc", 1.0, 0, "bcnv", 10.0, 0)
- w.plcol(2)
+ w.plcol0(2)
w.pllab("Year", "Widget Sales (millions)", "#frPLplot Example 12")
y0 = [5, 15, 12, 24, 28, 30, 20, 8, 12, 3]
for i in range(10):
- w.plcol(i + 1)
+ w.plcol0(i + 1)
w.plpsty(0)
fbox( w, (1980. + i), y0[i] )
string = `y0[i]`
@@ -56,7 +56,7 @@
x = [x0, x0, x0 + 1., x0 + 1.]
y = [0., y0, y0, 0.]
w.plfill(x, y)
- w.plcol(1)
+ w.plcol0(1)
w.pllsty(1)
w.plline(x, y)
Modified: trunk/examples/python/x13.py
===================================================================
--- trunk/examples/python/x13.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x13.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -36,7 +36,7 @@
## pl.init()
w.plenv(0., 10., 0., 10., 1, -2)
- w.plcol(2)
+ w.plcol0(2)
per = [10, 32, 12, 30, 16]
theta0 = 0.
@@ -55,10 +55,10 @@
y.append(5 + 3 * math.sin(theta))
theta = theta + dthet
- w.plcol(i + 1)
+ w.plcol0(i + 1)
w.plpsty((i + 3) % 8 + 1)
w.plfill(x, y)
- w.plcol(1)
+ w.plcol0(1)
w.plline(x, y)
just = (theta0 + theta1) / 2.
dx = .25 * math.cos(just)
Modified: trunk/examples/python/x16.py
===================================================================
--- trunk/examples/python/x16.py 2011-03-19 21:14:10 UTC (rev 11653)
+++ trunk/examples/python/x16.py 2011-03-19 21:21:23 UTC (rev 11654)
@@ -91,9 +91,9 @@
shade_min, shade_max, sh_cmap, sh_color, sh_width,
min_color, min_width, max_color, max_width, 1 )
- w.plcol(1)
+ w.plcol0(1)
w.plbox( "bcnst", 0., 0, "bcnstv", 0., 0 )
- w.plcol(2)
+ w.plcol0(2)
# plcont(w, nx, ny, 1, nx, 1, ny, clevel, ns, mypltr, NULL);
@@ -118,9 +118,9 @@
min_color, min_width, max_color, max_width,
1, 'pltr1', xg1, yg1 )
- w.plcol(1)
+ w.plcol0(1)
w.plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 )
- w.plcol(2)
+ w.plcol0(2)
# plcont(w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr1, (void *) &cgrid1);
@@ -145,9 +145,9 @@
min_color, min_width, max_color, max_width,
0, 'pltr2', xg2, yg2 )
- w.plcol(1)
+ w.plcol0(1)
w.plbox( "bcnst", 0.0, 0, "bcnstv", 0.0, 0 )
- w.plcol(2)
+ w.plcol0(2)
# plcont(w, nx, ny, 1, nx, 1, ny, clevel, ns, pltr2, (void *) &cgrid2);
@@ -210,10 +210,10 @@
# Now we can draw the perimeter.
- w.plcol(1)
+ w.plcol0(1)
w.plline( px, py )
# And label the plot.
- w.plcol(2)
+ w.plcol0(2)
w.pllab( "", "", "Tokamak Bogon Instability" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|