Choice of function plot colour.

Choice of function plot colour. - Сообщения

#1 Опубликовано: 07.02.2012 06:17:45
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Welcome.
Since this is my first post in this forum (even though I`m watching the development of applications for about a year or two), than first of all I would like to thank Andrey for this great app, so Andrey "Thank You".

I must say that I am not a mathematician, just an ordinary civil engineer, so my knowledge of "advanced mathematics" is absolutely fundamental. But even for me, it is almost impossible not to note the potential of this software in the calculation of engineering structures. For some time I try to carry part of the calculation of spreadsheets or other programs and collect in Smath algorithms.

At the moment I prepare a simple algorithm that eliminates the need for looking into the engineering tables. The task is simple, with a matrix of size I-beams (so-far only the I-beams), the algorithm reads the dimensions corresponding to the declared variable. For these dimensions calculates other parameters (excluding the chamfers between the webs and belts). The most important is to evaluate the indicator of the cross-section. The next step is to plot the cross-section with the appropriate dimensions.





And here comes my questions.

For the first, is it possible to pick the colour of plotted function (determined as a matrix, in my case the shape of I-beam -> plot_k.I ), as you can see at the first picture, the dimension lines are red and green, and it doesn`t look good. (the functions for dimension lines are wymiar.hI and wymiar.bI)

The second question, is it possible to avoid drawing a plot border.

The third question, for now, is ploting the tekst. While using format (ordinate x, ordinate y, "plotted tekst", tekst size/charakter size, "colour"), "plotted tekst" must be a tekst field. If so, then i have to prepare a second matrix with dimensions declared as "tekst", that will be plotted.

And one more question, is it posiible to plot a filled shape.

To see what i wanted to ask for, and to show how this algorithm works i attached the file link below.
https://smath.com/wiki/GetFile.aspx?File=I-beam_matrix.zip

If anyone knows better sollutions i`d be thankful for any advices.

P.S. @Andrey. I don`t know much about programming, but if it is not too confusing, have you considered of including possibility of changing fonts?
P.S.2. I`ve noticed in Feature Requests, a request for page indication, so vote me in too.

Best regards.
Rafal
Best regards. Rafal
#2 Опубликовано: 07.02.2012 09:31:52
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,

Nice work
Wrote

For the first, is it possible to pick the colour of plotted function (determined as a matrix, in my case the shape of I-beam -> plot_k.I ), as you can see at the first picture, the dimension lines are red and green, and it doesn`t look good. (the functions for dimension lines are wymiar.hI and wymiar.bI)


I do not think it could be changed at the moment. Functions and two column matrix can be plotted as lines (points) but there is no way to change colors, thickness etc - there is a default set of colors and their order. Colors can be changed by having five column matrix as you described (ordinate x, ordinate y, "plotted text", text size/character size, "color" ) but you can not have lines here as before.
Wrote

The second question, is it possible to avoid drawing a plot border.


No, I do not think there is such possibility implemented yet .
Wrote

The third question, for now, is ploting the tekst. While using format (ordinate x, ordinate y, "plotted tekst", tekst size/charakter size, "colour"), "plotted tekst" must be a tekst field. If so, then i have to prepare a second matrix with dimensions declared as "tekst", that will be plotted.


Did not understand this one, sorry. Plotting text means that you give coordinates in the first two columns, the third column is the appropriate text constant or text variable (text field) which will be put in the plot and the coordinate is upper left corner of the text.
Wrote

And one more question, is it posiible to plot a filled shape.


No, I do not think so. Although you can plot a huge character, point (see the animation examples made by @Ber7)

There might be some tricks on this by editing the *.sm file with some tags - but do not know about if there is any.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Опубликовано: 07.02.2012 10:14:54
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Hi there again and many thanks for fast reply.

Wrote


Wrote

The third question, for now, is ploting the tekst. While using format (ordinate x, ordinate y, "plotted tekst", tekst size/charakter size, "colour"), "plotted tekst" must be a tekst field. If so, then i have to prepare a second matrix with dimensions declared as "tekst", that will be plotted.


Did not understand this one, sorry. Plotting text means that you give coordinates in the first two columns, the third column is the appropriate text constant or text variable (text field) which will be put in the plot and the coordinate is upper left corner of the text.



I will try to clarify it a little. The point is that I have already declared I_in matrix which has all the necessary cross-sectional dimensions. I also have a function that searches the first column of the matrix I_in and checks whether the value entered in this particular line agrees with k.I If this is true, various dimensions are read from the matrix and assigned to corresponding variables (h.I, b.I, ...). Now, having already read out the dimensions (in the meantime are carried out calculations of other parameters of the section), I'd like to see them at the plot. If, following the formula text is displayed using a five column matrix. In the third column, we need to enter text, but I would like that this text would be captured directly from the values ​​that have been previously read out from the matrix (ie, those h.I, b.I, ...). Typing (ordinate x, y ordinate, h.I, text size / nature of the size, "color"), wont work. I sholuld type (ordinate x, y ordinate, "h.I", text size / nature of the size, "color"), but it will print "h.I" text not the value.
So the question is: Is it possible to print the value or do i have to declare identical matrix, composed of text values (like the first column of I_in).
I`ll try to post some pictures this evening.
Best regards. Rafal
#4 Опубликовано: 07.02.2012 13:18:19
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,
Wrote

....but it will print "h.I" text not the value.
So the question is: Is it possible to print the value or do i have to declare identical matrix, composed of text values (like the first column of I_in).


I think I understand now. You have a variable with units and you want to print its value on the plot, haven't you? Try to use num2str() function. If you have units involved you have to divide it by the appropriate unit in order to get rid of units and to play a bit to get the desired value represented as string (inside double quotes). This way you will get a string (or assign it to a string variable) which can be used in five column matrix to print it on the plot. Here is an example to give you an idea to play with.

[LIVE width=428 height=355]http://smath.info/live/?file=3500[/LIVE]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Опубликовано: 07.02.2012 14:13:36
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Alright.
I decided to write a new post instead of editing the previous one.
I have also decided to prepare a simpler task to illustrate my question.

Let us assume, that we have a set of four rectangles and we do not know at this stage, of which of them we will need for further calculations. So we have to prepare a simple function of searching, which allows us at any time, choose any of the declared shape and display its parameters (the function seems to be no sense for the four rectangles described by two parameters, but the assumption is that it supposed to work on a collection of nearly 1,000 items where each of them is described by six parameters). Below presentation of our 4 rectangles, search function and e.g. calculation.


Now, when we have selected our "rectangle", and we can change our selection at any time, let us force Smath to draw our rectangle, with dimensions presentation.
And here comes my problem On the upper-right side of picture below we have deffiniton of text plot, for vertical and horizontal dimmensions. I could leave it like this, that is with relative descriptions a, b.



But i wouldn`t be myself if i wouldn`t try to complicate everything :d . I wish to plot on my drawing exact value.
I found a short-term solution. I need to declare a identical matrix where dimensions would be declared as text [drawing below, added functions with orange background]



Because both matrixes are almoust identical, then i can use the same search function (long live the laziness). Only output paramaters will have different name.
Now i can put those parameters into text ploting format as on the picture below.



Now it does it`s job, but i feel that there is simple way . And what`s more, for my 1000 elements matrix i certainly don`t want to rewrite it manually.

File included.
https://smath.com/wiki/GetFile.aspx?File=mr_raf_user_files%5csearch_function%5cSearch_function_plot.zip

P.S. Referring to the question from my first post, regarding the filing of the shapes in the drawing. I asked abut it, because i`m trying to prepare algorithm for calculating an indirect foundation, piles for example, nothing then, just a layer of soil will be separated by lines.

I know that the market is full of software performing all the engineer calculations, but it does not relieve the designer of the responsibility, first of all. Secondly, when you prepare something yourself, you are sure what is going on inside. And thirdly, well prepared algorithm can be printed out without any settings, jus simple changes of input parameters and ready and this is a significant save of time.

P.S.2 Ouu... I didn`t noticed that You have replied my post while I was prepering my, ekhem, instruction of my idea ;]. But I`ll leave my post maybe someone will look for those answers. And as for your solution of my problem, then You are briliant, that is exacly what I was looking for, works perfectly for me.

Thanks a lot. Thumb up, and back to work. When I`ll finish some algorithm I`ll post them.
Best regards. Rafal
#6 Опубликовано: 07.02.2012 14:41:58
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello Rafal,

I am glad that I was of any help to you . Wish you good luck.
Maybe someone will have some better suggestions.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#7 Опубликовано: 07.02.2012 19:05:31
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

Hi,

for the question about the units I think you can use something like this:



best regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Radovan Omorjan 08.02.2012 02:00:00
#8 Опубликовано: 08.02.2012 03:21:29
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Hi.
Wrote

Hi,

for the question about the units I think you can use something like this:
(...)



In fact, I was just about to ask the question: "If it`s possible to display the units too".
But You read my mind :d

So it looks like I'll have to look at more "advanced" functions of Smath, which I had so far avoided.
Best regards. Rafal
#9 Опубликовано: 21.03.2012 03:26:47
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Hi there again.
I have a question regarding the ability to plot a decimal value.
Ploting a integer value, doesn`t bring any problem, but trying to plot decimal value is the thing that I can`t handle with.

Ilustration:


So is there a way to plot a text f.e. "17.321".

It is the ability that is an extremely desirable for me :d , for example to comply with internal forces diagrams.
For now I had to replace with such a procedure. I`m plotting the name of the variable as a text and below the charts I give the value.



It does it`s job. But I wonder if there`s a way to plot a decimal value.
Best regards. Rafal
#10 Опубликовано: 21.03.2012 04:04:17
kmihaylovich

kmihaylovich

8 сообщений из 131 понравились пользователям.

Группа: User

Maybe this will help?


decimal2str.sm
1 пользователям понравился этот пост
Davide Carpi 21.03.2012 04:37:00
#11 Опубликовано: 21.03.2012 04:50:51
Fridel Selitsky

Fridel Selitsky

520 сообщений из 451 понравились пользователям.

Группа: User

Converting real number into a string

http://smath.info/live/?file=3591
1 пользователям понравился этот пост
Davide Carpi 21.03.2012 06:05:00
#12 Опубликовано: 21.03.2012 05:09:07
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Hi again.

@kmihaylovich While using negative value your function plots "-17.-82545" as shown below.
@Ber7 Thanks for reply, your function is used below kmihaylovich`s function plot.
BTW Functions arranged by you and your animated graphs just embarrass me. , maybe you could write a tutorial

Best regards. Rafal
#13 Опубликовано: 21.03.2012 07:24:30
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,

I hope you will agree that this is quite to complicated. I suppose there should be some simpler way of performing this - by not using the relatively complex functions presented by @kmihaylovich and @Ber7 to perform a relatively simple task of putting a decimal number into the plot. I do not know how to do this in a simpler way. I hope that Andrey will have the answer in order do this in a more simple way.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#14 Опубликовано: 21.03.2012 09:26:09
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

I do agree with You Radovan. This is rather complicated, I mean, as for me.
Function arranged by Ber7 realy blew me of, on the second or third look at the function I do understand the way it works, but creating it is beyound my reach, as for now... maybe later, I hope. But even Ber7`s feature has some limitation, it does not display correctly the output function of seeking the maximum value in the matrix (max: =), as shown below [graph on the right, value in the frame box]:


Problem is, that it prints the whole procedure for each element of matrix while it should take the maximum value found in matrix. But I asume that this is a max: = disadvantage.
At the graph on the left, which plots bending moments, i didn`t use max: =. For this simple case anyone knows where the max. moment is, so i plotted it.
[MATH]M(H.e):p.H*L.e*{H.e^2}/2[/MATH].

BTW. Placing an exact value on the graph looks very elegant.

Below I include file, my live version at work gets errors:
(tekst unfortunately is only in Polish, as for now)
wiki_file "Decimal_number_plot"

P.S.
Because discussion has developed, it wouldn`t be a bad idea to create separate topic of it.
Best regards. Rafal
#15 Опубликовано: 21.03.2012 10:46:01
Fridel Selitsky

Fridel Selitsky

520 сообщений из 451 понравились пользователям.

Группа: User

Instead of num2strD2(fmax/m) you should write num2strD2(eval(fmax/m))
Regards,Ber7
#16 Опубликовано: 21.03.2012 16:57:05
mr_raf

mr_raf

1 сообщений из 13 понравились пользователям.

Группа: User

Wrote

Instead of num2strD2(fmax/m) you should write num2strD2(eval(fmax/m))
Regards,Ber7



Thanks Ber7 that really did the trick.
So again, the problem doesn`t lie in the application, or its features but in my lack of understanding of the application itself. Need to practise more :d.

I found a little bit of time to finish my searching funtion.

H _beam_matrix - wiki_upload_file

If anyone has any ideas how to simplify it or any other ideas, please be welcome to post.
Best regards. Rafal
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений