cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Translate the entire conversation x

Chart component. Units of the axes

Sergey
15-Moonstone

Chart component. Units of the axes

Hello!

 

Does anybody know how to change the units (from m to mm, m^2 to mm^2) in the chart component graph?

Please, take a look at the attached file.

 

Best regards, 

Sergey

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Sergey)

No, the native Prime plot does not support a second y-axis (you may make two separate plots) as it also does not support grid lines (workarounds for this have been posted in the forum a couple of times as Luc already wrote) and also does not offer labels or a legend (PTC had suggested to use manually placed text regions for this - yes, honestly!).

PTC has promised to improve the quality and functionality of Primes native plots in future version, we will see what this promise is worth.

Nonetheless for me, too, the Chart component is not an acceptable alternative as it dos not support units as Luc already wrote, is extremely slow and awkward to use and it does not respect the scale factor set in Windows and so the component is rather useless if a small display with a hight 4k resolution is used.

This means that neither of the two options for creating plots is really satisfactory and you have to choose what for you is the lesser of two evils.

 

See some suggestions in the attached P10 file

 

View solution in original post

9 REPLIES 9
LucMeekes
23-Emerald IV
(To:Sergey)

Yes: by not using the chart component. It is a badly integrated third party component, unaware of units. So it will just take the default (SI) units.

If you want to control units in a graph, use the native graphing possibilities (Plot menu). And if you want/need a grid in that graph, use one of the many utilities posted here on this forum.

If you insist on using the chart component, divide your X and Y variables by the desired units.

 

Success!
Luc

Sergey
15-Moonstone
(To:LucMeekes)

Hello Luc.

 

Is it possible to plot in Mathcad with 2 Y-axes? Would you show some example if possible?

Where do I find more information about the grid on the native Mathcad plot?

 

Sergey

Werner_E
25-Diamond I
(To:Sergey)

No, the native Prime plot does not support a second y-axis (you may make two separate plots) as it also does not support grid lines (workarounds for this have been posted in the forum a couple of times as Luc already wrote) and also does not offer labels or a legend (PTC had suggested to use manually placed text regions for this - yes, honestly!).

PTC has promised to improve the quality and functionality of Primes native plots in future version, we will see what this promise is worth.

Nonetheless for me, too, the Chart component is not an acceptable alternative as it dos not support units as Luc already wrote, is extremely slow and awkward to use and it does not respect the scale factor set in Windows and so the component is rather useless if a small display with a hight 4k resolution is used.

This means that neither of the two options for creating plots is really satisfactory and you have to choose what for you is the lesser of two evils.

 

See some suggestions in the attached P10 file

 

Sergey
15-Moonstone
(To:Werner_E)

Thank you!

Sergey
15-Moonstone
(To:Werner_E)

How would you use vector instead of vector index? 

Would you create 30x1 vector instead?

 

I tried range variable but it won't work.

 

Best regards,

Sergey

 

Sergey_1-1744906999470.png

 

 

LucMeekes
23-Emerald IV
(To:Sergey)

What you try there indeed does not work with a range:

LucMeekes_0-1744910655466.png

It runs without error with a vector:

LucMeekes_1-1744910691169.png

But I think you are looking for this result:

LucMeekes_2-1744910755346.png

That is, you need to vectorise the expression.

 

Success!
Luc

 

Werner_E
25-Diamond I
(To:Sergey)

You probably misunderstood what i wrote in the file. I meant that it is not necessary to use the vector index "i" after you already created the vector.

For creating the vector "stroke" you can use the range variable "i" as you did, but when you calculate A and Q the index can be omitted, but you will have to vectorize (the arrow over the expression) the calculation so that Prime knows you want the calculation to be done for each element of the vector(s) and don't use vector multiplication.

Vectorization is mandatory in the calculation of A because the expression in the parenthesis is a vector and the expression after it is a vector as well. So Prime would apply vector multiplication resulting in one single scalar value.
Vectorization would not be necessary in case of the calculation of Q but I consider it good habit (and it avoids mistakes) to always explicitly vectorize calculations when a calculations should be applied to the elements of a vector and not the vector itself.

Werner_E_0-1744914112239.png

There is nothing wrong with the way you created your vector "stroke" using a range variable "i" to index its elements, but there are also other ways to create a vector.

You could use programming and a for-loop

Werner_E_1-1744914285461.png

Actually that's quite similar to the range approach as basically a range is sort of an implicit loop and not a data structure.

 

You may also use the "matrix" function as Luc suggested

Werner_E_2-1744914371523.png

or using the "max" function as Luc did

Werner_E_4-1744914874941.png

 

Or you may use a range and turn it into a vector. In Prime 10 you have to use a user-function to do so, in Prime 11 a function "vec" is already built-in:

Werner_E_3-1744914463857.png

Benefit of the methods shown is that you don't need to define an extra global variable (the range "i").

 

So chose your weapons ... 😉

 

 

 

 

Sergey
15-Moonstone
(To:Werner_E)

I really like the "vec" function and the way it converts range variable into the vector. I think it is the to do it as I see it.

 

 

JeffH1
16-Pearl
(To:Sergey)

In the input section of your Chart Component, just divide your expressions by the units you wish to be displayed.  The only caveat is plotting temperatures in °F or °C, where you must use these units raised to the -1 power.  Everything else can be expressed as a full unit inverse (i.e. lb/BTU) or 1 divided by the expression.  This is exactly how the plot tool worked in Legacy Mathcad.  Unfortunately, the Chart Component doesn't have the nice units fields that the native plot tool was given in Mathcad Primes, but the Chart Component allows many more plot features and formatting and is worth getting used to.  

Announcements

Top Tags