Skip to content

Feature: multiple Y-axis scales on a single chart #2239

Open
@JafferWilson

Description

@JafferWilson

For bug reports, please include the following:

  • TensorBoard version (from pip package, also printed out when running tensorboard)
    1.12.0
  • TensorFlow version if different from TensorBoard
  • OS Platform and version (e.g., Linux Ubuntu 16.04)
    Windows 10 Professional Desktop
  • Python version (e.g. 2.7, 3.5)
    Python 3.5.0

Here are the two examples:
1 perfectly worked as the scales was same:

import tensorflow as tf
from numpy import random

writer_1 = tf.summary.FileWriter("./logs/plot_1")
writer_2 = tf.summary.FileWriter("./logs/plot_2")

log_var = tf.Variable(0.0)
tf.summary.scalar("loss", log_var)

write_op = tf.summary.merge_all()

session = tf.InteractiveSession()
session.run(tf.global_variables_initializer())

for i in range(100):
    # for writer 1
    summary = session.run(write_op, {log_var: random.rand()})
    writer_1.add_summary(summary, i)
    writer_1.flush()

    # for writer 2
    summary = session.run(write_op, {log_var: random.rand()})
    writer_2.add_summary(summary, i)
    writer_2.flush()
    print(i)

Got this figure which was understandable :
good image

But take a look at the second case where the values do not fit in the same range. In that case I need to have two different axes on same chart, so that I get a good and understandable image. Check the code:

import tensorflow as tf
from numpy import random

writer_1 = tf.summary.FileWriter("./logs/plot_1")
writer_2 = tf.summary.FileWriter("./logs/plot_2")

log_var = tf.Variable(0.0)
tf.summary.scalar("loss", log_var)

write_op = tf.summary.merge_all()

session = tf.InteractiveSession()
session.run(tf.global_variables_initializer())

for i in range(100):
    # for writer 1
    summary = session.run(write_op, {log_var: i*10})
    writer_1.add_summary(summary, i)
    writer_1.flush()

    # for writer 2
    summary = session.run(write_op, {log_var: random.rand()})
    writer_2.add_summary(summary, i)
    writer_2.flush()
    print(i)

See the image obtained:
bad image

Please help me with this query.
I have tried many things and even have placed this question on Stackoverflow but there is no response.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions