Choice of function plot colour. - Сообщения
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
Nice work

WroteFor 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.
WroteThe second question, is it possible to avoid drawing a plot border.
No, I do not think there is such possibility implemented yet .
WroteThe 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.
WroteAnd 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
Wrote
WroteThe 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.
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
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


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

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.
I am glad that I was of any help to you

Maybe someone will have some better suggestions.
Regards,
Radovan
for the question about the units I think you can use something like this:

best regards,

w3b5urf3r
WroteHi,
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.
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.
http://smath.info/live/?file=3591
@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.



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
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.
Regards,Ber7
WroteInstead 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.
-
Новые сообщения
-
Нет новых сообщений