Alan W. Irwin schrieb:
[...]
> Clearly, in the case of example 32 a circular symbol was meant.
> examples/python/test_circle.py contains a number non-unicode and unicode
> ways of generating such symbols.  Example 1 and Example 6 show additional
> methods of generating circular symbols.  I suggest example 32 be simplified
> to use one of those methods rather than using the local "plcircle" function
> that is currently implemented in x32c.c to duplicate that already-existing
> PLplot core functionality for generating circular symbols.

I agree. Here is the patch to use plpoin as in examples 1 and 6.

What gets lost, though, is the demonstration of how to get the axis
ratio for drawing custom symbols.

Robert

Index: examples/c/x32c.c
===================================================================
--- examples/c/x32c.c   (revision 10006)
+++ examples/c/x32c.c   (working copy)
@@ -58,6 +58,10 @@
     static PLFLT uw[] = { 1.071, 1.062, 1.093, 1.045, 1.072, 
                          1.067, 1.085, 1.024, 1.057, 1.071 };
 
+    /* outliers */
+    static PLFLT outx[] = { 3.5, 6.5 };
+    static PLFLT outy[] = { 0.89, 1.09 };
+
     static PLFLT pos[] = {0.0, 0.25, 0.5, 0.75, 1.0};
     static PLFLT red[] = {0.0, 0.25, 0.5, 1.0, 1.0};
     static PLFLT green[] = {1.0, 0.5, 0.5, 0.5, 1.0};
@@ -91,8 +95,7 @@
     }
 
     /* some outliers */
-    plcircle(3.5, 0.89);
-    plcircle(6.5, 1.09);
+    plpoin(2, outx, outy, 20); /* small circle, see PLplot example 06 */
 
 /* Don't forget to call plend() to finish off! */
 
@@ -179,33 +182,3 @@
     pllsty(1);
     plline(2, barx, bary);
 }
-
-void
-plcircle(PLFLT x, PLFLT y)
-{
-    PLFLT vpxmin, vpxmax, vpymin, vpymax; 
-    PLFLT px, py;
-    PLINT pxlen, pylen, pxoff, pyoff;
-    PLFLT axisratio, pageratio, circleratio, rx, ry;
-    int i;
-    static PLFLT cx[31], cy[31];
-
-    /* get circle axis ratio */
-    plgvpw(&vpxmin, &vpxmax, &vpymin, &vpymax);
-    axisratio = (vpxmax -vpxmin) / (vpymax -vpymin);
-    
-    plgpage(&px, &py, &pxlen, &pylen, &pxoff, &pyoff);
-    pageratio = pxlen * 1. / pylen;
-
-    circleratio = axisratio / pageratio;
-
-    ry = 0.001;
-    rx = circleratio * ry;
-    for (i = 0; i <= 30; ++i) {
-       cx[i] = x + cos(i / 30. * 2. * M_PI) * rx;
-       cy[i] = y + sin(i / 30. * 2. * M_PI) * ry;
-    }
-
-    pllsty(1);
-    plline(31, cx, cy);
-}
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to