Skip to content

Commit 08a6cd2

Browse files
Added Plot::removePensFrom()
1 parent 719d4e9 commit 08a6cd2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/plot.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ namespace ecolab
180180
penLabel.clear(); penTextLabel.clear(); penSide.clear();
181181
}
182182

183+
/// remove all pens from pen and above from plot
184+
void removePensFrom(unsigned pen);
185+
183186
// //serialisation support (surface is not auto-serialisable)
184187
// void pack(classdesc::pack_t& p) const override {p<<m_image<<x<<y<<minx<<maxx<<miny<<maxy;}
185188
//

src/plot.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,13 @@ namespace ecolab
309309
penSide[pen]=side;
310310
}
311311

312+
void Plot::removePensFrom(unsigned pen)
313+
{
314+
if (x.size()>pen) x.resize(pen);
315+
if (y.size()>pen) y.resize(pen);
316+
redraw();
317+
}
318+
312319
bool Plot::onlyMarkers() const
313320
{
314321
bool r=true;

0 commit comments

Comments
 (0)