Skip to content

Commit 291a2eb

Browse files
committed
Adapted from ModiaPlot_PyPlot by changing result to sigTable
1 parent 3dd6703 commit 291a2eb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/SignalTablesInterface_PyPlot.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module SignalTablesInterface_PyPlot
2020

2121

2222
# It seems that rcParams settings has only an effect, when set on PyPlot in Main
23-
import SignalTables
23+
using SignalTables
2424
import Measurements
2525
import MonteCarloMeasurements
2626

@@ -132,19 +132,19 @@ end
132132

133133

134134
"""
135-
addPlot(names, result, grid, xLabel, xAxis, prefix, reuse, maxLegend, MonteCarloAsArea, figure, i, j, nsubFigures)
135+
addPlot(names, sigTable, grid, xLabel, xAxis, prefix, reuse, maxLegend, MonteCarloAsArea, figure, i, j, nsubFigures)
136136
137137
Add the time series of one name (if names is one symbol/string) or with
138138
several names (if names is a tuple of symbols/strings) to the current diagram
139139
"""
140-
function addPlot(collectionOfNames::Tuple, result, grid::Bool, xLabel::Bool, xAxis, prefix::AbstractString, reuse::Bool, maxLegend::Integer,
140+
function addPlot(collectionOfNames::Tuple, sigTable, grid::Bool, xLabel::Bool, xAxis, prefix::AbstractString, reuse::Bool, maxLegend::Integer,
141141
MonteCarloAsArea::Bool, figure::Int, i::Int, j::Int, nsubFigures::Int)
142142
xsigLegend = ""
143143
nLegend = 0
144144

145145
for name in collectionOfNames
146146
name2 = string(name)
147-
(xsig, xsigLegend, ysig, ysigLegend, ysigType) = SignalTables.getPlotSignal(result, name2; xsigName = xAxis)
147+
(xsig, xsigLegend, ysig, ysigLegend, ysigType) = SignalTables.getPlotSignal(sigTable, name2; xsigName = xAxis)
148148
if !isnothing(xsig)
149149
nLegend = nLegend + length(ysigLegend)
150150
if ndims(ysig) == 1
@@ -177,7 +177,7 @@ addPlot(name::Symbol , args...) = addPlot((string(name),), args...)
177177

178178

179179
#--------------------------- Plot function
180-
function plot(result, names::AbstractMatrix; heading::AbstractString="", grid::Bool=true, xAxis=nothing,
180+
function plot(sigTable, names::AbstractMatrix; heading::AbstractString="", grid::Bool=true, xAxis=nothing,
181181
figure::Int=1, prefix::AbstractString="", reuse::Bool=false, maxLegend::Integer=10,
182182
minXaxisTickLabels::Bool=false, MonteCarloAsArea=false)
183183

@@ -192,16 +192,16 @@ function plot(result, names::AbstractMatrix; heading::AbstractString="", grid::B
192192
PyPlot.pygui(true) # Use separate plot windows (no inline plots)
193193

194194

195-
if isnothing(result)
196-
@info "The call of ModiaPlot.plot(result, ...) is ignored, since the first argument is nothing."
195+
if isnothing(sigTable)
196+
@info "The call of SignalTables.plot(sigTable, ...) is ignored, since the first argument is nothing."
197197
return
198198
end
199199
xAxis2 = isnothing(xAxis) ? xAxis : string(xAxis)
200200
PyPlot.figure(figure)
201201
if !reuse
202202
PyPlot.clf()
203203
end
204-
heading2 = SignalTables.getHeading(result, heading)
204+
heading2 = getHeading(sigTable, heading)
205205
(nrow, ncol) = size(names)
206206

207207
# Add signals
@@ -222,7 +222,7 @@ function plot(result, names::AbstractMatrix; heading::AbstractString="", grid::B
222222
# Remove xaxis tick labels, if not the last row
223223
ax.set_xticklabels([])
224224
end
225-
addPlot(names[i,j], result, grid, xLabel, xAxis2, prefix, reuse, maxLegend, MonteCarloAsArea, figure, i, j, nrow*ncol)
225+
addPlot(names[i,j], sigTable, grid, xLabel, xAxis2, prefix, reuse, maxLegend, MonteCarloAsArea, figure, i, j, nrow*ncol)
226226
k = k + 1
227227
if ncol == 1 && i == 1 && heading2 != "" && !reuse
228228
PyPlot.title(heading2)

0 commit comments

Comments
 (0)