Skip to content

Commit dc08226

Browse files
authored
fix bug in plotting systems with several rules (#30)
* fix bug in plotting systems with several rules * update changelog
1 parent f59a5e7 commit dc08226

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/src/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
- ![](https://img.shields.io/badge/new%20feature-green.svg) added semi-elliptic membership functions
88
- ![](https://img.shields.io/badge/new%20feature-green.svg) added `gensurf` to plot generating surface
9+
- ![](https://img.shields.io/badge/bugfix-purple.svg) fix plotting of systems with several rules and membership functions.
910

1011
## v0.1.2 -- 2023-03-12
1112

src/plotting.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ end
8080
nin = length(fis.inputs)
8181
nrules = length(fis.rules)
8282
layout := (nrules, nin + nout)
83+
size --> (300 * (nin + nout), 200 * nrules)
8384
for rule in fis.rules
8485
ants = leaves(rule.antecedent)
8586
for (varname, var) in pairs(fis.inputs)

test/test_plotting.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ end
8989
@test p.args == d
9090
if isempty(d)
9191
@test p.plotattributes == Dict(:plot_title => "tipper", :grid => false,
92-
:legend => false, :axis => false, :layout => (3, 3))
92+
:legend => false, :axis => false, :layout => (3, 3),
93+
:size => (900, 600))
9394
else
9495
@test p.plotattributes ==
95-
Dict(:plot_title => "tipper", :title => t, :layout => (3, 3))
96+
Dict(:plot_title => "tipper", :size => (900, 600), :title => t,
97+
:layout => (3, 3))
9698
end
9799
end
98100
end

0 commit comments

Comments
 (0)