• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Plotting and Saving results as PNG

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 15793
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Plotting and Saving results as PNG

shayansh
shayansh over 13 years ago

 Hi,

I am trying to write some code to plot a few eye diagrams and then save the result in a PNG file. I am using Cadence Version: "IC.6.1.5.500.11". What i have done is declared a variable in the outputs with the expression load("plotrand.ocn"). Inside the plotrand.ocn file, i have placed the following code. The results plot, the eye diagrams show up correctly, and they are in two subwindows just like i want it. However, when i say save the file, it only saves one of the subwindows. The PNG file does not include both of the subwindows as i want it. 

There are two other things i would like to do if possible!

1) To resize the window before saving the PNG file. I have tried the awvResizeWindow as well as "hiResizeWindow(awvGetCurrentWindow() list(0:0 1400:1050))" with no luck.

2) To remove the legend that is displayed on the side and make it display it on the "inside". This can be achieved through the menues, but i wanted to do it automatically. 

Thanks,

Shayan

Contents of "plotrand.ocn"

real ENDTIME = 0;
real STARTTIME = 0;
hardCopyOptions(?hcOutputFile "test3.png")
clearAll()

DFE_Eye = eyeDiagram(VT("/Veq_dfe") STARTTIME ENDTIME 3.3333e-10)
plot( DFE_Eye ?expr '( "DFE_Eye" ) )
yLimit( list(-400m 400m) ?stripNumber 1])

number = addSubwindow()
LinearEQ_Eye = eyeDiagram(VT("/Veq") STARTTIME ENDTIME 3.3333e-10)
plot( LinearEQ_Eye ?expr '( "LinearEQ_Eye" ) )
yLimit( list(-400m 400m) ?stripNumber 1])


hardCopyOptions(?hcOutputFile "test3.png")
hardCopy()

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    From 6.1.5.500.12 (ISR12) you can also specify these options in hardCopyOptions(). Note that ?hcUseExistingBackground doesn't currently work - this should be addressed (I believe) in 6.1.5.500.14 (a couple of hotfixes away). If you use ?hcMakeExactCopy in 6.1.5.500.12 it will save all subwindows in one image - we're also working to allow multiple subwindows to be saved into the image in other modes. Hope this helps...

    All these options will work only for save image.
    
    1. ?hcMakeExactCopy : To save the exact copy of plots as seen in current subwindow.
                                       Only ?hcQuality and ?hcOutputFile arguments will work with this option. 
                                       Valid values : t / nil.    
                                       Default value : nil  
    
    2. ?hcQuality : To change the quality of image.
                          This works only for .jpeg file format.
                          Valid values : 20 to 100%
                          Default value : 85
     
    3. ?hcOptimizeForWindows :  To optimize image for Microsoft Office.
                                              This option works only for 'eps' file format.
                                              For all other formats, this will always be default set to 't'.
                                              Valid values : t / nil. 
    
    4.  ?hcImageWidth : To set width for size of image.
                                  Valid values : Any positive integer value.
                                  Default value : 800 pixels
       
    5.  ?hcImageHeight : To set height for size of image.
                                   Valid values : Any positive integer value.
                                   Default value : 600 pixels                                
    
    6.  ?hcImageSizeUnits : To set unit for image size(height and width).
                                       Valid values : inch, cm, mm, picas, pixels, points.
                                       Default value : pixels.
    
    ?hcResolution and ?hcResolutionUnits works only for bmp, jpeg, png,  ppm,  tif,  xpm file formats. For eps,  pdf,  svg these will not work.
    7.  ?hcImageResolution : To set the image resolution.
                                         Valid Value : Any positive integer value.
                                         Default value : 96 
    
    8.  ?hcResolutionUnits :    To set the units for image resolution.
                                          Valid values : pixels/cm and pixels/in
                                          Default value :   pixels/in
    
    9.  ?hcImageAspectRatio :  To enable the aspect ratio.  
                                            When enabled, aspect ratio will let find out ?hcHeight and ?hcWidth arguments if other is not given.                                       
                                            Valid values : t / nil
                                            Default value : nil      
    
    10. ?hcUseExistingBackground : To use the existing background.
                                                   Valid values : t/ nil
                                                   Default value : nil 
    
    11. ?hcDisplayTitle : To enable displaying trace title in image.
                                  Valid values : t / nil
                                  Default value : t
    
    12. ?hcDisplayLegend : To enable displaying trace legend in image.
                                       Valid values : t / nil
                                       Default value : t 
     
    ?hcDisplayGrids can't be set to 't' when ?hcDisplayAxes is 'nil'.
    13. ?hcDisplayAxes :  To enable displaying trace axes in image.
                                    Valid values : t / nil
                                    Default value : t
       
    14. ?hcDisplayGrids : To enable displaying grids in image.
                                    Valid values : t / nil.
                                    Default value : t
    
    Arguments ?hcMakeExactCopy, ?hcQuality, ?hcResolution and ?hcResolutionUnits will not be honored for 'eps' file format. Thus, if given be ignored.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbchang
    mbchang over 13 years ago

    Andrew,

    I tried to add the ?hcMakeExactCopy t in the hardCopyOptions in 6.1.5.500.12 but I still only see 1 subwindow got saved. Have you tried this before? Is any other option that I can try to save all of the subwindows?

     

    Thanks.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    I just checked (I was sure I checked a few days ago, but I thought I'd check again). I did:

    hardCopyOptions(?hcOutputFile "./test.png" ?hcMakeExactCopy t)
    hardCopy()

    and I got this picture.

    Andrew.

    • test.png
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information