cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Combine two types of plots?

kris.koorndyk
1-Newbie

Combine two types of plots?

Is it possible to create a plot with two different trace types?

The idea is to plot a continuous signal using the line trace and plot a stem trace to illustrate discrete sample times on the continuous signal.

8 REPLIES 8

Is it possible to create a plot with two different trace types?

Yes, thats possible.

Next time you should state which software you are using (Prime or Mathcad) and which version.

Furthermore I suggest you attach a worksheet to show in more detail what you have in mind.

Yes. You just plot the same thing twice, and set the trace types differently for the two plots.

Ah, okay. I didn't think you could set the trace type separately.

Now, what I'd like to do is have a larger range for the continuous signal and a second range with smaller intervals to illustrate different sampling frequencies. However, I'm receiving an error stating that there are too many range variables. I assume that's because the X axis is defined as t whereas my s(n) function uses n.

I can adjust the interval of t and just plot y(t) twice with one of them set to stem trace, but as I adjust the interval, the continuous plot loses "smoothness".

Thank you for the quick responses!

I'm using Mathcad Express Prime 3.0.

You need to have two x-axis variables as well as two y-axis variables. Also note that Mathcad Prime 3.0 can't plot more than 4999 points. That is kind of pathetic, given that Mathcad 15 can plot 500,000 points, and people have been complaining about that limitation for at least a decade, but that's the way it is. I believe the number of points may be greater in the next version, but I don't know what the new limit will be.

There used to be very low total point limits in Prime 1 and 2.

In Prime 3 the limit for line plots was raised to 500000 as in real Mathcad. Still silly but better than the 50000 we had before in P2.

Obviously for column, bar and stem traces the limit is a low 5000 (as in Prime 1, I think) - unbelievable.

Thanks so much! I actually tried to add a second variable to the x axis but wasn't sure how to. Nothing I had tried was working, but it looks like a simple SHIFT+ENTER did the trick!

You may also choose "Add Trace" from the menu.

Guess you should rather plot y(n) instead of s(n) as second plot.

s(n) will yield just zeros at the selected n values.

Your ranges go high up and you just plot a small part of it.

So its a good idea to cut down the ranges so less points are to be plotted (there is a silly total point limit in Prime).

I would also suggest you add units to all variables, not just the amplitude.

See if the attached file is close to what you wanted to achieve.

Top Tags