molecoder
molecoder

Reputation: 473

Change bar chart view angle / perspective

Recently I've been playing with an R package named latticeExtra and created the following chart

3D Bar Chart

with this code

library(latticeExtra)

heisenberg <- read.csv(file="ABSOLUTE_FILE_LOCATION")

x <- heisenberg[[1]]
y <- heisenberg[[2]]
z <- heisenberg[[3]]

cloud(z~x+y, heisenberg, panel.3d.cloud=panel.3dbars, col.facet='green',
      xbase=0.4, ybase=0.4,scales=list(arrows=FALSE, col=1), 
      par.settings = list(axis.line = list(col = "transparent")))

I'm still not happy just by looking at the cube containing the chart from this angle / perspective.

Do you know how I can change the view angle to like the opposite side?

Upvotes: 0

Views: 94

Answers (1)

molecoder
molecoder

Reputation: 473

In order to change the perspective, we use

screen = list(z = 0, x = 0, y = 0)

and change the values of z, x and y in accordance to what we want.

This code where z = 90, x = -45, y=0

library(latticeExtra)

heisenberg <- read.csv(file="C:/Users/tiago/Desktop/VIS/DATA/4/sample_1000.csv")

x <- heisenberg[[1]]
y <- heisenberg[[2]]
z <- heisenberg[[3]]

cloud(z~x+y, heisenberg, panel.3d.cloud=panel.3dbars, col.facet='green',
      xbase=0.4, ybase=0.4,scales=list(arrows=FALSE, col=1),
      screen = list(z = 90, x = -45, y=0),
      par.settings = list(axis.line = list(col = "transparent")))

Gives this chart

3D Bar Chart with different perspective

Upvotes: 1

Related Questions