Bases: object
Scale plot axis with units system
Fluid properties are calculated in SI units for internal use. Axis ticks of the plot can be scaled to show data in other unit systems.
Parameters: | plot_units (str) – Unit system for for plotting (‘kSI’ or ‘SI’) |
---|
Set limits for axes
Parameters: |
|
---|
This will give the coordinates and rotation required to align a label with a line on a plot
Bases: object
Bases: CoolProp.Plots.Common.BasePlot
Draw lines with constant values of type ‘which’ in terms of x and y as defined by ‘plot’. ‘iMin’ and ‘iMax’ are minimum and maximum value between which ‘num’ get drawn.
There should also be helpful error messages...
This is the core method to obtain lines in the dimensions defined by ‘plot’ that describe the behaviour of fluid ‘Ref’. The constant value is determined by ‘iName’ and has the values of ‘iValues’.
‘iValues’ is an array-like object holding at least one element. Lines are calculated for every entry in ‘iValues’. If the input ‘num’ is larger than the amount of entries in ‘iValues’, an internally defined pattern is used to calculate an appropriate line spacing between the maximum and minimum values provided in ‘iValues’.
Returns lines[num] - an array of dicts containing ‘x’ and ‘y’ coordinates for bubble and dew line. Additionally, the dict holds the keys ‘label’ and ‘opts’, those can be used for plotting as well.
Make a pressure-temperature plot for the given fluid
Note
CoolProps.Plots.PT() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import PT
>>> PT('R290', show=True)
>>> from CoolProp.Plots import PT
>>> PT('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> PT('R290', show=True, axis=ax)
Make a pressure-enthalpy plot for the given fluid
Note
CoolProps.Plots.Ph() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import Ph
>>> Ph('R290', show=True)
>>> from CoolProp.Plots import Ph
>>> Ph('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> Ph('R290', show=True, axis=ax)
Make a pressure-density plot for the given fluid
Note
CoolProps.Plots.Prho() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import Prho
>>> Prho('R290', show=True)
>>> from CoolProp.Plots import Prho
>>> Prho('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> Prho('R290', show=True, axis=ax)
Bases: CoolProp.Plots.Common.BasePlot
Create graph for the specified fluid properties
>>> from CoolProp.State import State
>>> from CoolProp.Plots import PropsPlot
>>> plt = PropsPlot('Water', 'Ph')
>>> plt.show()
>>> plt = PropsPlot('n-Pentane', 'Ts')
>>> plt.set_axis_limits([-0.5, 1.5, 300, 530])
>>> plt.draw_isolines('Q', [0.1, 0.9])
>>> plt.draw_isolines('P', [100, 2000])
>>> plt.draw_isolines('D', [2, 600])
>>> plt.show()
>>> fluid = 'Water'
>>> p_min = 20
>>> p_max = 15e3
>>> T_max = 550 + 273.15
>>> S1 = State(fluid, dict(P=p_min, Q=0)) # condenser outlet
>>> S2 = State(fluid, dict(P=p_max, S=S1.s)) # isentropic compression
>>> S3 = State(fluid, dict(P=p_max, T=T_max)) # isobaric heating
>>> S4 = State(fluid, dict(P=p_min, S=S3.s)) # isentropic expansion
>>> Ts = PropsPlot(fluid, 'Ts')
>>> Ts.draw_process([S1, S2, S3, S4, S1])
>>> Ts.show()
Note
See the online documentation for a the available fluids and graph types
Create isolines
Parameters: |
|
---|
Draw process or cycle from list of State objects
Parameters: |
|
---|
Make a pressure-entropy plot for the given fluid
Note
CoolProps.Plots.Ps() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import Ps
>>> Ps('R290', show=True)
>>> from CoolProp.Plots import Ps
>>> Ps('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> Ps('R290', show=True, axis=ax)
Make a temperature-density plot for the given fluid
Note
CoolProps.Plots.Trho() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import Trho
>>> Trho('R290', show=True)
>>> from CoolProp.Plots import Trho
>>> Trho('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> Trho('R290', show=True, axis=ax)
Make a temperature-entropy plot for the given fluid
Note
CoolProps.Plots.Ts() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import Ts
>>> Ts('R290', show=True)
>>> from CoolProp.Plots import Ts
>>> Ts('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> Ts('R290', show=True, axis=ax)
Draw lines with constant values of type ‘which’ in terms of x and y as defined by ‘plot’. ‘iMin’ and ‘iMax’ are minimum and maximum value between which ‘num’ get drawn.
Note
CoolProps.Plots.drawIsoLines() will be depreciated in future releases and replaced with CoolProps.Plots.IsoLines()
Examples
>>> from matplotlib import pyplot
>>> from CoolProp.Plots import Ts, drawIsoLines
>>>
>>> Ref = 'n-Pentane'
>>> ax = Ts(Ref)
>>> ax.set_xlim([-0.5, 1.5])
>>> ax.set_ylim([300, 530])
>>> quality = drawIsoLines(Ref, 'Ts', 'Q', [0.3, 0.5, 0.7, 0.8], axis=ax)
>>> isobars = drawIsoLines(Ref, 'Ts', 'P', [100, 2000], num=5, axis=ax)
>>> isochores = drawIsoLines(Ref, 'Ts', 'D', [2, 600], num=7, axis=ax)
>>> pyplot.show()
Just an internal method to systematically plot values from the generated ‘line’ dicts, method is able to cover the whole saturation curve. Closes the gap at the critical point and adds a marker between the two last points of bubble and dew line if they reach up to critical point. Returns the an array of line objects that can be used to change the colour or style afterwards.
Make a enthalpy-entropy plot for the given fluid
Note
CoolProps.Plots.hs() will be deprecated in future releases and replaced with CoolProps.Plots.PropsPlot()
Examples
>>> from CoolProp.Plots import hs
>>> hs('R290', show=True)
>>> from CoolProp.Plots import hs
>>> hs('R290', show=True, Tmin=200, Tmax=300)
>>> from matplotlib import pyplot
>>> fig = pyplot.figure(1)
>>> ax = fig.gca()
>>> hs('R290', show=True, axis=ax)
This file implements a psychrometric chart for air at 1 atm
This function plots an economized cycle, on the current axis, or that given by the optional parameter axis
Required parameters:
Optional parameters:
This function plots a simple four-component cycle, on the current axis, or that given by the optional parameter axis
Required parameters:
Optional parameters:
This function plots a two-stage cycle, on the current axis, or that given by the optional parameter axis
Required parameters:
Optional parameters: