Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve line styles in plotting code #47

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/tgentools/tgentools
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ will override the default pattern 'tgen.*\.log'.""",
matplotlib's plot command (see matplotlib.pyplot.plot)""",
metavar="LIST", type=str,
action="store", dest="lineformats",
default=util.LINEFORMATS)
default=util.LINE_FORMATS)

visualize_parser.add_argument('-e', '--expression',
help="""Append a regex PATTERN to a custom list of strings used with
Expand Down
7 changes: 6 additions & 1 deletion tools/tgentools/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
except ImportError:
from io import StringIO

LINEFORMATS = "k-,r-,b-,g-,c-,m-,y-,k--,r--,b--,g--,c--,m--,y--,k:,r:,b:,g:,c:,m:,y:,k-.,r-.,b-.,g-.,c-.,m-.,y-."
LINE_COLORS = ['k', 'r', 'b', 'g', 'c', 'm', 'y']
LINE_STYLES = ['-', '--', '-.', ':']

# since there are 7 colors and 4 styles (no common factor), there will be 28
# distinct color/style combinations before it repeats
LINE_FORMATS = ','.join([x[0] + x[1] for x in zip(LINE_COLORS*10, LINE_STYLES*10)])

def make_dir_path(path):
p = os.path.abspath(os.path.expanduser(path))
Expand Down