graph - format of the numbers

Moderator: GiD Team

pgeissler
Posts: 14
Joined: Mon Jul 20, 2015 1:56 pm

graph - format of the numbers

Post 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
User avatar
anna
Posts: 38
Joined: Wed Sep 17, 2014 10:53 am

Re: graph - format of the numbers

Post 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
Hemmi
Posts: 31
Joined: Fri Nov 20, 2015 6:05 am
Location: Chiba prefecture, Japan

Re: graph - format of the numbers

Post 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?
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: graph - format of the numbers

Post 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 3477 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)
Hemmi
Posts: 31
Joined: Fri Nov 20, 2015 6:05 am
Location: Chiba prefecture, Japan

Re: graph - format of the numbers

Post 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)
Attachments
GiD__Function_graph_EXP.zip
(162.58 KiB) Downloaded 100 times
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: graph - format of the numbers

Post 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.
Hemmi
Posts: 31
Joined: Fri Nov 20, 2015 6:05 am
Location: Chiba prefecture, Japan

Re: graph - format of the numbers

Post 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.
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: graph - format of the numbers

Post 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 3376 times
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: graph - format of the numbers

Post 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)
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: graph - format of the numbers

Post 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 3374 times
Post Reply