#329 trigonal/hexagonal axis system ( was: Plot Style Polygon)


I've wondered for a while now what the limitations are for implementing such a feature. I've found an extraordinarily convoluted work-around online (http://www.gnuplotting.org/object-placement-using-a-data-file/), but I believe the utility of the feature is sufficient to ask that this be part of core gnuplot functionality. The idea is as follows: say the user has a set of coordinates that describe a polygon, and they want to use this as their point type in a plot. This could be done using the "set object <index> polygon..." command. Then in the script type

plot sin(x) w polygon <index>

and the polygon object would be placed at the points specified by sin(x).

Additional parameters: the data could be read in like "with ellipses" currently are, in which the third column (major axis) and fourth column (minor axis) determine scaling in x and y, and fifth column (angle) rotates the polygon after scaling.


  • Douglas

    Douglas - 2012-06-12

    Here's a very useful application of polygon-based plotting, the two-dimensional hexbin: http://stackoverflow.com/questions/2369492/generate-a-heatmap-in-matplotlib-using-a-scatter-data-set/2371812#2371812

    The main idea is to plot a heatmap using hexagon tiles instead of square or rectangle tiles, since these have some desirable properties.

    As far as I can tell, the hexagon is not a point type, and even if it were, different terminals would scale the points differently making tiling inconsistent. Using the polygon style would resolve these issues.

  • Ethan Merritt

    Ethan Merritt - 2012-06-14

    I support the idea of adding a hexbin plot style. But the arguments in favor of this plot style are specific to hexagons; they don't apply to other polygons because other polygons do not tile the plane. If you do decide to work on adding a hexbin style, please keep in mind that the basic code can probably be designed to support barycentric plots as well. E.g. http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2007/msg00384.html

  • Douglas

    Douglas - 2012-06-15

    Hmm, that barycentric plot is interesting, although I can't at first glance see the difference between their plotting method and just using a heatmap with a discretized palette.

    Hexbin is interesting, but actually my initial interest in plotting with user-specified polygons was simply having more control over the output in different terminal types. For instance, point sizes can vary wildly vetween EPS and SVG, for example, and having the opportunity to make them more consistent while adding some good functionality is useful. Also, I work with astronomers who want to show feature extraction of galaxies. Currently, they use ellipses, which of course gnuplot can handle, but then the question comes when you want to show different astronomical objects. In that case, you might want different symbols representing different galaxy types, etc, except we do not have axis-specific scaling or rotation. Moreover, I find the point-type palette fairly limited, so being able to expand it arbitrarily on a use-by-use basis would be very helpful.

  • Ethan Merritt

    Ethan Merritt - 2012-06-15

    Barycentric plots have a trigonal (hexagonal) axis system, as does hexbin.

  • Ethan Merritt

    Ethan Merritt - 2012-06-15

    As to a larger selection of point symbols, I will offer the same advice I always do:
    use "with labels" and assign the desired symbol as a UTF-8 character. That gives you access to the full range of Unicode symbol definitions.

  • Ethan Merritt

    Ethan Merritt - 2012-07-05
    • summary: Plot Style Polygon --> trigonal/hexagonal axis system ( was: Plot Style Polygon)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks