I ran an AC analysis from 10Hz to 100MHz and stored the gain in dB waveform into a variable called Av_dB and the phase waveform into a variable called Phase. I'm writing a script as part of a bigger scenario so I plotted the result using the following command (I had already defined the window_id variable):
awvPlotWaveform( window_id \ list( Av_dB Phase ) \ ?expr list("mag" "phase") \ ?stripNumber list( 1 2 ) \ )
I thought it would also be instructive to highlight 0dB on the plot so I blindly tried:
awvPlotWaveform( window_id \ list( Av_dB 0 Phase ) \ ?expr list("mag" "0" "phase") \ ?stripNumber list( 1 1 2 ) \ )
but quickly found out that 0 isn't a waveform so it didn't work. Referencing a 10 year old thread:community.cadence.com/.../21756I eventually came up with something that worked: Zero_dB = artListToWaveform( '((10 0) (100M 0)) ) abSetUnits(Zero_dB "dB") abSetXUnits(Zero_dB "freq") awvPlotWaveform( window_id \ list( Av_dB Zero_dB Phase ) \ ?expr list("mag" "0" "phase") \ ?stripNumber list( 1 1 2 ) \ )
I'm the first to admit that the the above is pretty awkward, but I couldn't figure out how to do this obvious thing. Is there a better way?
P.S. I know about awvPlaceYMarker() but that doesn't work for plot strips, only subwindows.
Bonus points: Is there a way to plot a vertical line (i.e. at a given frequency) on just one of the above plot strips?
There isn't really a pretty way of adding curve that isn't just a variant on what you've done already. There's an enhancement CCR (1310040) asking for strip support on awvPlaceYMarker, but it's not been implemented yet (so you might want to contact customer support and ask for a duplicate). I can see how it could be done using the underlying (very private - too low level to reveal) API, so it's feasible in principle.
The vertical markers for your bonus point question don't cut it because they are across all strips. The only way you could do it is (I assume) add a two point vertical line between the ymin and ymax of the waveform on that strip. Another alternative might be to place a bookmark with awvPlaceBookmark() in the region you want to indicate something - that might be simpler?
Thanks Andrew. I did go looking for ways to access the ymin and ymax I got after plotting (i.e. the auto-scaled values) on a given strip but drew a blank. Do you know how to get that information?
No, I don't think there's a function for that. What I was talking about was using the ymin and ymax functions on whatever curve you've plotted in a particular strip rather than the axis limits.