Visdom: The heatmap plot is upside down

Created on 4 May 2017  路  1Comment  路  Source: fossasia/visdom

How to show them in a [not upside down] way?
Thank you!

from visdom import Visdom
import numpy as np
import math
import os.path
import getpass

viz = Visdom()

X = np.outer(np.arange(1, 6), np.arange(1, 11))
viz.heatmap(
    X=X,
    opts=dict(
        columnnames=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'],
        rownames=['y1', 'y2', 'y3', 'y4', 'y5'],
        colormap='Electric',
    )
)
print(X)

Most helpful comment

This is the default row order that Plotly uses. You can always manually flip the matrix if you want to have different behavior:

viz = Visdom()
X = np.outer(np.arange(1, 6), np.arange(1, 11))
viz.heatmap(
    X=np.flipud(X),
    opts=dict(
        columnnames=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'],
        rownames=['y5', 'y4', 'y3', 'y2', 'y1'],
        colormap='Electric',
    )
)
print(X)

>All comments

This is the default row order that Plotly uses. You can always manually flip the matrix if you want to have different behavior:

viz = Visdom()
X = np.outer(np.arange(1, 6), np.arange(1, 11))
viz.heatmap(
    X=np.flipud(X),
    opts=dict(
        columnnames=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'],
        rownames=['y5', 'y4', 'y3', 'y2', 'y1'],
        colormap='Electric',
    )
)
print(X)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jramapuram picture jramapuram  路  6Comments

ebagdasa picture ebagdasa  路  5Comments

wdroz picture wdroz  路  5Comments

dragen1860 picture dragen1860  路  6Comments

wj926 picture wj926  路  7Comments