Welcome to Golden Software Support

Scaling objects with fixed aspect ratio

Comments

4 comments

  • Avatar
    Sabrina Pearson

    Hi Andras,

    I would recommend changing the size of the colorscale in one direction manually and changing the size in the other direction using a factor. The factor is the amount of scaling up that was done in the manual direction. This is similar to dragging the size by the corner. To do this in a script, I would delete your:

    DiscreteColorScale.Select 
    Plot.Selection.Left = 25.8
    Plot.Selection.Top = 20.0
    Plot.Selection.Width = 0.8
    Plot.Selection.Height = 6
    Plot.Selection.DeselectAll

    section and would use:

    Set factor = DiscreteColorScale.Width/0.8 
    DiscreteColorScale.Width = 0.8
    DiscreteColorScale.Height = DiscreteColorScale.Height/factor

    Thanks!

    Sabrina

    0
    Comment actions Permalink
  • Avatar
    morcosmacko
    Thanks Sabrina, it works fine! Andras
    0
    Comment actions Permalink
  • Avatar
    Vitaliy

    I optimized this example for my task:

        ContinuousColorScale.Width = ContinuousColorScale.Width*ylength/ContinuousColorScale.Height
        ContinuousColorScale.Height = ylength

    I have fixed height, equal to ylength, so I calculate needed width.

    Anyway this is type of crutch, it would be better to have property like object.yMapPerPU, as it works for ContourMap.


     

    0
    Comment actions Permalink
  • Avatar
    Drew Dudley

    Hi Vitaliy,

    Thank you for posting your solution. I have added a vote to our suggestion file, upon your behalf, for future versions of Surfer to have the yMapPerPu property for the color scale object. 

    Please let me know if I can be of any further assistance!

    Sincerely,
    Drew Dudley
    Technical Support

    0
    Comment actions Permalink

Please sign in to leave a comment.