|
Hello,
just curious about something. I'm trying to plot several data vectors in a single plot and separate the different vectors by using plot/line markers.
The thing is that I'd like to have a good resolution on my plot, i.e. as few straight lines between the data points (no interpolating), but without ending up with i.e. 1000 line markers directly next to each other, making the plot a thick line of i.e. square line markers.
As for now, the best way to do this as I know of is to first plot the data vector as a "continuous" line (regular plot), and in the same figure plot just a few line markers of the same data vector with a convenient step between each marker, and for the plot this looks exactly as I want it to look.
The code for such a plot would be
plot(x, f(x), '-r', x(1:dx:end), f(x(1:dx:end), 'sr').
But as soon as I want to add a legend, due to plotting several vectors in the same figure, the legend sample will either be the line, or just the line marker used.
This scenario is illustrated in the PDF I've uploaded here:
http://dump.no/files/1ece075f1871/test.pdf
As you can see in the upper figure the line markers are separated nicely, and I still get the smooth line showing the data. But for the legend, I can't find a way to get the two legend samples combined, as in the lower figure, where I've used the code
plot(x(1:dx:end), f(x(1:dx:end)). '-rs' )
to plot the data.
So to my first question: is there any way to combine the plot in the upper figure with the legend from the lower one?
For only one set of data, the upper figure would of course do fine, as there wouldn't be any need for the legend, but when plotting several sets of data, it would definitely look better if I could have legend samples as in the lower figure (IMO). I assume this isn't possible, but who knows, I might be lucky.
Best regards,
drgz
|