-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change colorbar number format #260
Comments
There is unfortunately no way currently to control this at user level. |
Do you think it would be a desired feature? I may look into it trying to add it once I defend. |
Definitely! If you can build GLVis yourself, the change is not hard -- the corresponding code is in the following lines:
and maybe you want a diff like: diff --git a/lib/vsdata.cpp b/lib/vsdata.cpp
index 1934414..9e69eac 100644
--- a/lib/vsdata.cpp
+++ b/lib/vsdata.cpp
@@ -497,7 +497,7 @@ void VisualizationSceneScalarData::PrepareColorBar (double minval,
val = ULogVal(i / 4.0);
ostringstream buf;
- buf << setprecision(4) << val;
+ buf << fixed << showpos << val;
color_bar.addText(text_x,Y,posz, buf.str());
}
}
@@ -509,7 +509,7 @@ void VisualizationSceneScalarData::PrepareColorBar (double minval,
Y = miny + (maxy - miny) * LogUVal(val);
ostringstream buf;
- buf << setprecision(4) << val;
+ buf << fixed << showpos << val;
color_bar.addText(text_x,Y,posz, buf.str());
}
} |
@ddkn, were you able to resolve this? |
Discussion continued in #288 |
Hello,
Looking at the documentation I wasn't sure how to change the string format on the colorbar, or is this even possible? I would like it to be more consistent. Depending on the amount of significant figures you may get a float or scientific notation in the same colorbar.
It would be nice to have more control, such as show sign (+ and -) and control the significant figures after the decimal, e.g. +3.145e+00 and -3.145e+00. Again, I apologize if I have missed this option
Or is there a better way to export this for plotting?
Thanks in advance!
PS I believe
glvis
was installed throughpip install glvis==0.3.3
, which I think pulled in the latest binary 4.2The text was updated successfully, but these errors were encountered: