Is it possible gplot to have different line size, any help appreciated too

조회 수: 4 (최근 30일)
Is it possible gplot to have different line size. Assume I have xyz table, while the xy columns of coordinates and z column is describe size of line. It should be noted that connection table (i.e 0 or 1) is available since is mandatory for gplot function. Looking any recent knowledge as well as any help appreciated too

채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 29일
No, that is not possible with gplot.
You could examine and modify the File Exchange Contribution that extends gplot to 3D, but you would need to modify it a fair bit.
gplot and the equivalent file exchange contribution work by building a single line with all of the coordinates, putting in NaN between the line segments as plot() and plot3() interpret NaN as indicating a break in drawing. The difficulty with this approach is that this generates a single lineseries() (or line() for sufficiently old versions), and each of those can only have a single color and style and width associated. In order to have different lines with different thicknesses, it would be necessary to plot them as distinct lines.
There are some approaches like looping using plot() for each item. There is another approach, which is that if you can put all of the data into a single 2D array then each column of Y will generate a distinct line; you can then set() the line width property of each line.
  댓글 수: 1
Eng. Fredius Magige
Eng. Fredius Magige 2015년 9월 30일
Hi Walter; OK, it seem very tough task, I think is working but need time. A matrix is generated from another table which is also very tough to manipulate as has many nodes from main, sub-main to lateral hydraulic pipeline. In few weeks to come I will conform its function-ability. Thanks too

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Steven Lord
Steven Lord 2015년 9월 29일
Don't use GPLOT. Use the new graph functionality in release R2015b instead. Take a look at the documentation for GRAPH for more information. When you plot a graph, you can change the sizes of individual edges independent of other edges. As a very simple example, create the Buckminster Fuller geodesic dome (soccer ball, buckyball) graph and plot it.
g = graph(bucky);
h = plot(g);
Now highlight the edges between node 6 and its neighbors by increasing the line width and making the edges red.
highlight(h, 6, neighbors(g, 6), 'LineWidth', 5, 'EdgeColor', 'r')
  댓글 수: 2
Eng. Fredius Magige
Eng. Fredius Magige 2015년 9월 30일
Hi Steven; ok, is it Linewidth 5 to be variable (?)i.e changes as many a possible, and it can work in R2010b. I am generating a hydraulic layout, describing the size 16, 20, to 2000mm of pipes with pressure rate (PN 6,10 to 25)
Walter Roberson
Walter Roberson 2015년 9월 30일
R2010b does not support those functions; they are new as of R2015b.

댓글을 달려면 로그인하십시오.


Eng. Fredius Magige
Eng. Fredius Magige 2019년 6월 24일
The new release MatLab has gplot/g with capability to generate different line width with colors by weight characteristics/functionality. Thanks MatLab tool

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by