Articles on Trending Technologies

Technical articles with clear explanations and examples

How to draw a rectangle over a specific region in a Matplotlib graph?

Rishikesh Kumar Rishi
Rishikesh Kumar Rishi
Updated on 06-May-2021 844 Views

To draw a rectangle over a specific region in a matplotlib graph, we can take the following steps −Using subplots() method, create a figure and a set of subplots, where nrows=1.Using rectangle, we can create a rectangle, defined via an anchor point and its width and height. Where, edgecolor=orange, linewidth=7, and facecolor=green.To plot a diagram over the axis, we can create a line using plot() method, where line color is red.Add a rectangle patch on the diagram, using add_patch() method.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt, patches plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True figure, ax = plt.subplots(1) ...

Read More

How to create a draggable legend in Matplotlib?

Rishikesh Kumar Rishi
Rishikesh Kumar Rishi
Updated on 06-May-2021 2K+ Views

To create a draggable legend in matplotlib, we can take the following steps −Create two lines, line1 and line2, using plot() method.Place the legend for plot line1 and line2 with ordered lables at location 1, using legend() method.To create a draggable legend, use set_draggable() method, where state=True. If state=False, then we can't drag the legend.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True line1, = plt.plot([1, 2, 3]) line2, = plt.plot([3, 2, 1]) leg = plt.legend([line2, line1], ["line 2", "line 1"], loc=1) leg.set_draggable(state=True) plt.show()OutputOn the output window, you can drag the legend around with ...

Read More

Automatically Rescale ylim and xlim in Matplotlib

Rishikesh Kumar Rishi
Rishikesh Kumar Rishi
Updated on 06-May-2021 2K+ Views

To rescale ylim and xlim automatically, we can take the following steps −To plot a line, use plot() method and data range from 0 to 10.To scale the xlim and ylim automatically, we can make the variable scale_factore=6.Use scale_factor (from Step 2) to rescale the xlim and ylim, using xlim() and ylim() methods, respectively.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True plt.plot(range(0, 10)) scale_factor = 6 xmin, xmax = plt.xlim() ymin, ymax = plt.ylim() plt.xlim(xmin * scale_factor, xmax * scale_factor) plt.ylim(ymin * scale_factor, ymax * scale_factor) plt.show()Output

Read More

How do I plot Shapely polygons and objects using Matplotlib?

Rishikesh Kumar Rishi
Rishikesh Kumar Rishi
Updated on 06-May-2021 7K+ Views

To plot shapely polygons and objects using matplotlib, the steps are as follows −Create a polygon object using (x, y) data points.Get x and y, the exterior data, and the array using polygon.exterior.xy.Plot x and y data points using plot() method with red color.Examplefrom shapely.geometry import Polygon import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True polygon1 = Polygon([(0, 5),    (1, 1),    (3, 0),    (4, 6), ]) x, y = polygon1.exterior.xy plt.plot(x, y, c="red") plt.show()Output

Read More

What is Dijikstra Algorithm?

Ginni
Ginni
Updated on 05-May-2021 827 Views

The shortest path routing algorithm is an extensively set up non-adaptive routing algorithm that routes a packet dependent on Dijkstra's important shortest path algorithm. In this methodology, packets that appear at a node take one of the shortest paths to a specific destination on the system.The shortcoming of this manner is that it does not consider the modification in the network traffic powerfully. For instance, queuing brings congestion in the middle nodes developing in packets being deferred before arriving at the destination. In this approach, it would be beneficial to advance packets to choose routes that cannot be the shortest ...

Read More

What is the architecture of Asynchronous Transfer Mode?

Ginni
Ginni
Updated on 05-May-2021 8K+ Views

ATM is a connection-oriented network at a point where the sender or user which access devices are known as end-point, these end-points connected through a user to network interface (UNI) to the switches on the network, these switches provide a network to network interface (NNI).The architecture of the ATM is shown in the figure below.ATM transfers the information through a transmission path which is made up of a logical virtual path and virtual channel. The transmission path consists of the physical cable, which is connected to an ATM switch. The cables have a transfer speed of up to 155 megabits ...

Read More

What is Code Division Multiplexing?

Ginni
Ginni
Updated on 05-May-2021 2K+ Views

An ultimate form of multiplexing used in parts of the cellular telephone system and for some satellite communication is called Code Division Multiplexing (CDM). The specific version of CDM used in cell phones is called Code Division Multi-Access (CDMA).CDM does not rely on physical properties, including frequency or time. It can depend on an interesting numerical idea such as values from orthogonal vector spaces can be merged and separated without interference. The specific form used in the telephone network is the easiest to learn. Each sender is created a unique binary code Ci that is called chip sequence.Chip sequences are ...

Read More

What is Asynchronous Transmission?

Ginni
Ginni
Updated on 05-May-2021 1K+ Views

A transmission system is classified as asynchronous if the system enables the physical channel to be useless for an arbitrary time between two transmissions. The asynchronous design of communication is well-appropriated to applications that create data at random (e.g., a user classifying on a keyboard or a user that press on a link to include a web page, reads for a while, and then press on a link to include another page).The drawback of asynchrony improves from the lack of coordination between sender and receiver while the channel is empty. A receiver cannot know how long the channel will remain ...

Read More

What is Serial Transmission?

Ginni
Ginni
Updated on 05-May-2021 13K+ Views

The alternative to parallel transmission, called serial transmission, sends one bit at a time. With the importance of speed, it may seem that anyone designing a data communications system would choose parallel transmission. However, most communication systems use serial mode.Following are the two main reasons for serial transmission−First, serial networks can be continued over long distances at much less cost because fewer physical wires are required, and intermediate electronic elements are less cheap.Second, using only one physical wire defines that there are never timing issues caused by one wire being slightly higher than another (a difference of millimetres can be ...

Read More

What is FDDI in the Computer Network?

Ginni
Ginni
Updated on 05-May-2021 5K+ Views

FDDI stands for Fiber Distributed Data Interface. It is a collection of ANSI and ISO standards for data transmission on fiber-optic lines in a local area network (LAN) that can broaden in the range up to 200 km (124 miles). The FDDI protocol depends on the token ring protocol.FDDI cabling consists of two fiber rings, one transmitting clockwise and the other transmitting counterclockwise. Fiber Distributed Data Interface (FDDI) is generally implemented as a dual token-passing ring within a ring topology (for campus networks) or star topology (inside a building). The dual ring includes a primary and secondary ring.The primary ring ...

Read More
Showing 41781–41790 of 61,248 articles
Advertisements