diff src/graphics.cc @ 9347:3da821b161e9

imported patch ticklabel
author Michael Goffioul <michael.goffioul@gmail.com>
date Sun, 14 Jun 2009 22:49:54 +0100
parents c539ec5726e7
children 610bf90fce2a
line wrap: on
line diff
--- a/src/graphics.cc	Sun Jun 14 16:10:12 2009 -0400
+++ b/src/graphics.cc	Sun Jun 14 22:49:54 2009 +0100
@@ -3424,6 +3424,24 @@
   ticks = tmp_ticks;
 }
 
+void
+axes::properties::calc_ticklabels (const array_property& ticks,
+				   any_property& labels, bool logscale)
+{
+  Matrix values = ticks.get ().matrix_value ();
+  Cell c (values.dims ());
+  std::ostringstream os;
+
+  for (int i = 0; i < values.numel (); i++)
+    {
+      os.str (std::string ());
+      os << values(i);
+      c(i) = os.str ();
+    }
+
+  labels = c;
+}
+
 static void
 get_children_limits (double& min_val, double& max_val, double& min_pos,
 		     const Matrix& kids, char limit_type)