Home > Community > Forums > Custom IC SKILL > Plotting and Saving results as PNG

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Plotting and Saving results as PNG 

Last post Thu, Sep 6 2012 7:53 AM by Andrew Beckett. 3 replies.
Started by shayansh 16 Jul 2012 11:59 AM. Topic has 3 replies and 1916 views
Page 1 of 1 (4 items)
Sort Posts:
  • Mon, Jul 16 2012 11:59 AM

    • shayansh
    • Not Ranked
    • Joined on Fri, Apr 2 2010
    • Posts 14
    • Points 280
    Plotting and Saving results as PNG Reply

     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()

    • Post Points: 20
  • Mon, Sep 3 2012 9:57 PM

    Re: Plotting and Saving results as PNG Reply

    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.

     

    • Post Points: 20
  • Thu, Sep 6 2012 7:21 AM

    • mbchang
    • Not Ranked
    • Joined on Thu, Sep 6 2012
    • Posts 9
    • Points 150
    Re: Plotting and Saving results as PNG Reply

    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.

     

    • Post Points: 20
  • Thu, Sep 6 2012 7:53 AM

    Re: Plotting and Saving results as PNG Reply

    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.


    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by shayansh at 16 Jul 2012 11:59 AM. Topic has 3 replies.