Page 1 of 2

graph - format of the numbers

Posted: Mon Aug 03, 2015 4:24 pm
by pgeissler
Hi,

I wanted to change the format of the numbers along the axis on a graph. Unfortunately changing the results format (Preferences - Format) doesn't have any influence of the format of these numbers. Is there any other command or possibility to adjust this format?
Because I don't want to use exponential representation of a number (1,000,000 instead of 1E+06) along an axis.

Best regards
Peter

Re: graph - format of the numbers

Posted: Thu Aug 06, 2015 1:35 pm
by anna
Unfortunately there is no option to change the number format for graphs.
We will discuss it in order to include it in next versions.

Regards

Re: graph - format of the numbers

Posted: Tue Jan 31, 2023 2:30 am
by Hemmi
Wrote on Tue Jan 31 10:28:45 JST 2023.
Am using GiD16.

What happened to the idea of introducing EXPONENTIAL for the values on the axes of the graph?

Re: graph - format of the numbers

Posted: Fri Feb 03, 2023 6:52 pm
by escolano
The graphs show exponential format when needed, but the format is automatic and it cannot be set manually.
See for example the Y-axis numbers
graph_with_exponential_numbers-Y.png
graph_with_exponential_numbers-Y.png (13.34 KiB) Viewed 3484 times
Please, could you attach a zip with your graph and specify how do you exactly want to be shown?
(can export it to a .grf file for example clicking the contextual menu on the graphs window and select Export graph)

Re: graph - format of the numbers

Posted: Sat Feb 04, 2023 7:21 am
by Hemmi
Thanks for the support.
The immediate problem now is trying to define a function in the material data.
I am attaching a file of the problem I encountered. However, it is long and I have modified it by hand to make it shorter.


escolano wrote: Fri Feb 03, 2023 6:52 pm The graphs show exponential format when needed, but the format is automatic and it cannot be set manually.
See for example the Y-axis numbers
graph_with_exponential_numbers-Y.png

Please, could you attach a zip with your graph and specify how do you exactly want to be shown?
(can export it to a .grf file for example clicking the contextual menu on the graphs window and select Export graph)

Re: graph - format of the numbers

Posted: Mon Feb 06, 2023 11:58 am
by escolano
We are talking of different graph tools
I was talking about the postprocess graph window, implemented in C++ and OpenGL
and by the picture of your attached example you are talking of the auxiliary graph shown in classical problemtype questions, with 'array fields'. This graphs is shown using the TkLib Plotchart scripting package.

I will study your example and provide some solution soon.

Re: graph - format of the numbers

Posted: Wed Feb 08, 2023 1:20 pm
by Hemmi
Thanks for your time.

Graph drawing is not an easy task from a general point of view.
An example of a classic tool is xgraph, and I have recently been using matplotlib as a modern graphing tool.
In any case, users have to specify many configuration parameters to get the desired graphs.
I suppose that GiD is not a graph drawing tool that needs to specify many configuration parameters, which means that less useful and complicated features will be added to GiD. Then, at the moment, I ask GiD developers to limit the role of graph drawing to quick checking of calculated or input parameters. In the future, I hope GiD will implement high quality graph drawing without complex configuration parameters.

Re: graph - format of the numbers

Posted: Wed Feb 08, 2023 7:51 pm
by escolano
I have updated the related graph exponential format (automatic) available in GiD 16.0.4 official and GiD 16.1.3d developer. Both GiD versions are available for download just today:
https://www.gidsimulation.com/gid-for-science/downloads
graph_exponential_axes.png
graph_exponential_axes.png (72.08 KiB) Viewed 3383 times

Re: graph - format of the numbers

Posted: Wed Feb 08, 2023 9:28 pm
by escolano
About the graphs of Python 'matplotlib', It is possible to obtain some 'similar graph' with the TclLib Plotchart package.
Can see here some images https://wiki.tcl-lang.org/page/Plotchart+gallery
(off course matplotlib is easier to use and more modern)

In fact I think that the matplotlib Python module is drawing in a Tcl/Tk canvas using TkInter (that is a wrap of the Tk's Tcl library to be called from Python)

Re: graph - format of the numbers

Posted: Wed Feb 08, 2023 9:33 pm
by escolano
A big new of GiD 16.1.2d developer is that is possible to run Python code from Tcl of GiD and vice-versa
https://gidsimulation.atlassian.net/wik ... hon+in+GiD
This show an example just using matplotlib:
https://gidsimulation.atlassian.net/wik ... ib+example

You can do a fast test writing this in the GiD lower entry
-np- GiD_Python_Exec {<paste_pyton_code_here>}
replacing <paste_pyton_code_here> by some example code of matplotlib like this
https://matplotlib.org/stable/plot_type ... tween.html

Code: Select all

import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# make data
np.random.seed(1)
x = np.linspace(0, 8, 16)
y1 = 3 + 4*x/8 + np.random.uniform(0.0, 0.5, len(x))
y2 = 1 + 2*x/8 + np.random.uniform(0.0, 0.5, len(x))

# plot
fig, ax = plt.subplots()

ax.fill_between(x, y1, y2, alpha=.5, linewidth=0)
ax.plot(x, (y1 + y2)/2, linewidth=2)

ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
       ylim=(0, 8), yticks=np.arange(1, 8))

plt.show()
Matplotlib_demo_run_in_GiD.png
Matplotlib_demo_run_in_GiD.png (11.99 KiB) Viewed 3381 times