Look at the following picture, I tried to get a heat plot with ggplot2, but there is a white vertical line on it. What happens? Anybody gives me an hint?
Besides, there is a white line on each side of plot, why couldn't the heat plot fill the whole part while the contour fill the whole part?
Lucky! I've sovled the problem with setting an ultra-small left or right margin.
Related
I often have to use plots mixing lines and points (ggplot2), with the colors of the line representing one variable (here, "Dose"), and the shape of the points another one (here, "Treatment). Figure 1 shows what I typically get:
Figure 1: what I get
I like having different legends for the two variables, but would like to remove the round markers from the color scale, to only show the colors (see legend mockup below, made with Gimp). Doing so would allow me to have a clean legend, with colors and shapes clearly segregated.
Figure 2 (mockup): what I would like
Would anyone know if there is a way to do that? Any help would be much appreciated.
Note: the plots above show means and error bars, but I have the same problem with any plot mixing geom_line and geom_point, even simple ones.
Thanks in advance !
I'm using the package Plots with the pyplot backend.
By default, errorbars are black. How can I change their color? I want to set it to the same color as the line itself (which should be the default behaviour imho).
using Plots
plot(1:3,1:3,yerr=0.1) # produces a blue line with black errorbars
markerstrokecolor/mscsets the color. Normally you'd put points on the plot as well, rather than just the line with error bars, the default is thus to have the stroke around each point in the same color as the error bar. If you feel that another default is better you'd be welcome to open an issue on Plots.
>
Hi,
I'm using a sample problem to learn the comsol.
I would like to let my case problem (left)
3D plot, be the same as the tutorial plot (right).
My problem is that, instead of the right figure plot (that shows the resin-red color traveling from the left edge to the right one), I'm getting the nonconforming left one.
Do you have an idea if there is a choice of getting the right plot, or an advice about why I get the left plot instead of the right?
Thank you in advance!
Panos Deemac
Your problem is the Colorbar. In the left the color goes up to 1x10^5 while in the right it goes to 1, thus drawing as red everything above 1. Change the color limits to the same, and you'll get the same plot.
I am trying to get a correct legend for a series of points in a plot, which look like:
plot(c(3,1),pch=21,bg="white",col="black")
points(c(2,1),pch=21,bg="black",col="black")
points(c(1,1),pch=21,bg="dark grey",col="black")
I thought the legend code would be:
legend("topright",legend=c('Point3','Point2','Point1'),pch=c(21,21,21),
bg=c('white','black','dark grey'),col=c('black','black','black'),bty='n')
But apparently I am wrong, because I only get three white points with black boarder. Why isn't this working and what is the correct code?
If you read help("legend") you find out that bg specifies the background of the legend. You need to use pt.bg:
legend("topright", legend=c('Point3','Point2','Point1'), pch=c(21,21,21),
pt.bg=c('white','black','dark grey'), col=c('black','black','black'), bty='n')
I am using a map_set call to draw a map, and then using contour to plot some data on top of it.
I want to add a legend to this plot to make it useful, but it would have to be below the entire plot, and everything I've tried creates an overlapping legend over top of my image.
Can you do two plots -- one for your contour map, and another for the colorbar/legend,
using the system variable !P.MULTI to lay them out one above the other? You might also
need to specify YMARGIN keywords appropriately on each plot to keep them from overlapping.
You use pre-written colorbar routines (cbar from JHU or colorbar from Coyote, for example) and use the POSITION keyword to put them exactly where you want them. You can also pass POSITION to MAP_SET to position that where you want it.