Skip to main content

Plot

Struct Plot 

Source
pub struct Plot {
    pub title: String,
    pub date: String,
    pub name: String,
    pub padded: bool,
    pub commands: Vec<String>,
    pub options: Vec<String>,
    pub dimensions: Option<Vec<usize>>,
    pub variables: Vec<Variable>,
    pub data: Data,
}
Expand description

One plot: a header plus a block of data (struct plot in the C).

Fields§

§title: String§date: String§name: String

The Plotname: line, e.g. Transient Analysis.

§padded: bool

Flags: … padded/unpadded: whether short vectors are padded with zeros up to No. Points in the data section.

§commands: Vec<String>§options: Vec<String>§dimensions: Option<Vec<usize>>

Dimensions: of the plot, when multidimensional (e.g. a nested .dc sweep). Product must equal No. Points.

§variables: Vec<Variable>§data: Data

Implementations§

Source§

impl Plot

Source

pub fn num_points(&self) -> usize

Source

pub fn is_complex(&self) -> bool

Source

pub fn scale(&self) -> Option<&Variable>

The scale vector: the first variable, by 3f5 convention (the writer moves the scale to the front before writing).

Source

pub fn variable_index(&self, name: &str) -> Option<usize>

Index of a variable by name, case-insensitive (vector names in the 3f5 front end compare with cieq).

Source

pub fn real_values(&self, name: &str) -> Option<&[f64]>

Real column by variable name, if this is a real plot.

Source

pub fn complex_values(&self, name: &str) -> Option<&[Complex64]>

Complex column by variable name, if this is a complex plot.

Source§

impl Plot

Source

pub fn write(&self, w: &mut impl Write, format: Format) -> Result<()>

Write this plot exactly as the 3f5 raw_write does.

The caller is responsible for the scale being variables[0] (the C moves it to the front; here it is an invariant of the in-memory plot).

Trait Implementations§

Source§

impl Clone for Plot

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Plot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Plot

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Plot

Auto Trait Implementations§

§

impl Forget for Plot

§

impl Freeze for Plot

§

impl Move for Plot

§

impl RefUnwindSafe for Plot

§

impl Send for Plot

§

impl Sync for Plot

§

impl Unpin for Plot

§

impl UnsafeUnpin for Plot

§

impl UnwindSafe for Plot

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.